mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-12 16:17:13 +01:00
Enable Status Icon Override
This commit is contained in:
@@ -167,7 +167,7 @@ class LuiPagesGen(object):
|
|||||||
if page_search_res is not None:
|
if page_search_res is not None:
|
||||||
name = name if name is not None else page_search_res.title
|
name = name if name is not None else page_search_res.title
|
||||||
text = get_translation(self._locale, "frontend.ui.card.button.press")
|
text = get_translation(self._locale, "frontend.ui.card.button.press")
|
||||||
icon_id = get_icon_id(icon) if icon is not None else get_icon_id("gesture-tap-button")
|
status_entity = None
|
||||||
if item.status is not None and self._ha_api.entity_exists(item.status):
|
if item.status is not None and self._ha_api.entity_exists(item.status):
|
||||||
status_entity = self._ha_api.get_entity(item.status)
|
status_entity = self._ha_api.get_entity(item.status)
|
||||||
icon_color = self.get_entity_color(status_entity)
|
icon_color = self.get_entity_color(status_entity)
|
||||||
@@ -177,6 +177,7 @@ class LuiPagesGen(object):
|
|||||||
icon_id = icon_id[:-1]
|
icon_id = icon_id[:-1]
|
||||||
else:
|
else:
|
||||||
icon_color = 17299
|
icon_color = 17299
|
||||||
|
icon_id = get_icon_id_ha("sensor", state=status_entity.state, overwrite=icon) if icon is not None else get_icon_id("gesture-tap-button")
|
||||||
return f"~button~{entityId}~{icon_id}~{icon_color}~{name}~{text}"
|
return f"~button~{entityId}~{icon_id}~{icon_color}~{name}~{text}"
|
||||||
else:
|
else:
|
||||||
return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~page not found~"
|
return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~page not found~"
|
||||||
|
|||||||
Reference in New Issue
Block a user