mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-01-07 15:15:48 +01:00
implement #301
This commit is contained in:
@@ -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":
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user