mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-23 07:54:25 +01:00
implements #218
This commit is contained in:
@@ -215,7 +215,7 @@ class LuiController(object):
|
|||||||
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
||||||
elif entity_id.startswith('script'):
|
elif entity_id.startswith('script'):
|
||||||
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
||||||
elif entity_id.startswith('light') or entity_id.startswith('switch') or entity_id.startswith('input_boolean'):
|
elif entity_id.startswith('light') or entity_id.startswith('switch') or entity_id.startswith('input_boolean') or entity_id.startswith('automation'):
|
||||||
self._ha_api.get_entity(entity_id).call_service("toggle")
|
self._ha_api.get_entity(entity_id).call_service("toggle")
|
||||||
elif entity_id.startswith('lock'):
|
elif entity_id.startswith('lock'):
|
||||||
if self._ha_api.get_entity(entity_id).state == "locked":
|
if self._ha_api.get_entity(entity_id).state == "locked":
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ class LuiPagesGen(object):
|
|||||||
icon_color = self.get_entity_color(entity)
|
icon_color = self.get_entity_color(entity)
|
||||||
icon_id = get_icon_id_ha("light", overwrite=icon)
|
icon_id = get_icon_id_ha("light", 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"]:
|
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)
|
icon_color = self.get_entity_color(entity)
|
||||||
icon_id = get_icon_id_ha(entityType, state=entity.state, overwrite=icon)
|
icon_id = get_icon_id_ha(entityType, state=entity.state, overwrite=icon)
|
||||||
|
|||||||
Reference in New Issue
Block a user