mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-21 13:44:45 +01:00
limit chars for power on us-p
This commit is contained in:
@@ -293,6 +293,13 @@ class LuiPagesGen(object):
|
|||||||
device_class = entity.attributes.get("device_class", "")
|
device_class = entity.attributes.get("device_class", "")
|
||||||
unit_of_measurement = entity.attributes.get("unit_of_measurement", "")
|
unit_of_measurement = entity.attributes.get("unit_of_measurement", "")
|
||||||
value = entity.state
|
value = entity.state
|
||||||
|
|
||||||
|
# limit value to 4 chars on us-p
|
||||||
|
if self._config.get("model") == "us-p":
|
||||||
|
value = entity.state[:4]
|
||||||
|
if value[-1] == ".":
|
||||||
|
value = value[:-1]
|
||||||
|
|
||||||
if device_class != "temperature":
|
if device_class != "temperature":
|
||||||
value = value + " "
|
value = value + " "
|
||||||
value = value + unit_of_measurement
|
value = value + unit_of_measurement
|
||||||
|
|||||||
Reference in New Issue
Block a user