mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-21 13:44:45 +01:00
implement #301
This commit is contained in:
@@ -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