mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-15 01:18:19 +01:00
Update pages.py
This commit is contained in:
@@ -235,11 +235,16 @@ class LuiPagesGen(object):
|
|||||||
icon_color = self.get_entity_color(entity, overwrite=colorOverride)
|
icon_color = self.get_entity_color(entity, overwrite=colorOverride)
|
||||||
icon_id = get_icon_id_ha("light", state=entity.state, overwrite=icon)
|
icon_id = get_icon_id_ha("light", state=entity.state, overwrite=icon)
|
||||||
return f"~{entityType}~{entityId}~{icon_id}~{icon_color}~{name}~{switch_val}"
|
return f"~{entityType}~{entityId}~{icon_id}~{icon_color}~{name}~{switch_val}"
|
||||||
if entityType in ["switch", "input_boolean", "automation", "fan"]:
|
if entityType in ["switch", "input_boolean", "automation"]:
|
||||||
switch_val = 1 if entity.state == "on" else 0
|
switch_val = 1 if entity.state == "on" else 0
|
||||||
icon_color = self.get_entity_color(entity, overwrite=colorOverride)
|
icon_color = self.get_entity_color(entity, overwrite=colorOverride)
|
||||||
icon_id = get_icon_id_ha(entityType, state=entity.state, overwrite=icon)
|
icon_id = get_icon_id_ha(entityType, state=entity.state, overwrite=icon)
|
||||||
return f"~switch~{entityId}~{icon_id}~{icon_color}~{name}~{switch_val}"
|
return f"~switch~{entityId}~{icon_id}~{icon_color}~{name}~{switch_val}"
|
||||||
|
if entityType in "fan":
|
||||||
|
switch_val = 1 if entity.state == "on" else 0
|
||||||
|
icon_color = self.get_entity_color(entity, overwrite=colorOverride)
|
||||||
|
icon_id = get_icon_id_ha(entityType, state=entity.state, overwrite=icon)
|
||||||
|
return f"~fan~{entityId}~{icon_id}~{icon_color}~{name}~{switch_val}"
|
||||||
if entityType in ["sensor", "binary_sensor"]:
|
if entityType in ["sensor", "binary_sensor"]:
|
||||||
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", "")
|
||||||
|
|||||||
Reference in New Issue
Block a user