This commit is contained in:
joBr99
2022-07-30 21:48:58 +02:00
parent d386332fe4
commit 141fe93a8b
2 changed files with 8 additions and 2 deletions

View File

@@ -288,7 +288,9 @@ class LuiController(object):
else:
self._ha_api.get_entity(entity_id).call_service("lock")
elif entity_id.startswith('button') or entity_id.startswith('input_button'):
self._ha_api.get_entity(entity_id).call_service("press")
self._ha_api.get_entity(entity_id).call_service("press")
elif entity_id.startswith('input_select'):
self._ha_api.get_entity(entity_id).call_service("select_next")
# for media page
if button_type == "media-next":

View File

@@ -282,7 +282,7 @@ class LuiPagesGen(object):
icon_color = self.get_entity_color(entity, overwrite=colorOverride)
text = get_translation(self._locale, "frontend.ui.card.lock.lock") if entity.state == "unlocked" else get_translation(self._locale, "frontend.ui.card.lock.unlock")
return f"~button~{entityId}~{icon_id}~{icon_color}~{name}~{text}"
if entityType == "number":
if entityType in ["number", "input_number"]:
icon_id = get_icon_id_ha("number", overwrite=icon)
min_v = entity.attributes.get("min", 0)
max_v = entity.attributes.get("max", 100)
@@ -291,6 +291,10 @@ class LuiPagesGen(object):
icon_id = get_icon_id_ha("input_text", overwrite=icon)
value = entity.state
return f"~text~{entityId}~{icon_id}~17299~{name}~{value}"
if entityType == "input_select":
icon_id = get_icon_id_ha("button", overwrite=icon)
text = entity.state
return f"~button~{entityId}~{icon_id}~17299~{name}~{text}"
return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~unsupported~"
def generate_entities_page(self, navigation, heading, items, cardType):