mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-08 14:26:34 +01:00
fixed sensors
This commit is contained in:
@@ -275,9 +275,12 @@ class NsPanelLovelanceUI:
|
|||||||
|
|
||||||
if item_type == "sensor":
|
if item_type == "sensor":
|
||||||
icon_id = 0
|
icon_id = 0
|
||||||
icon_id = {
|
icon_mapping = {
|
||||||
"temperature": 2
|
"temperature": 2
|
||||||
}[entity.attributes.device_class]
|
"power": 4
|
||||||
|
}
|
||||||
|
if entity.attributes.device_class in icon_mapping:
|
||||||
|
icon_id = icon_mapping[entity.attributes.device_class]
|
||||||
|
|
||||||
value = entity.state + " " + entity.attributes.unit_of_measurement
|
value = entity.state + " " + entity.attributes.unit_of_measurement
|
||||||
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, "text", item, icon_id, name, value)
|
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, "text", item, icon_id, name, value)
|
||||||
|
|||||||
Reference in New Issue
Block a user