From dafd117ea5b40b688b3a562ba1e3f3c5aa5cccba Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Fri, 6 May 2022 07:16:25 +0000 Subject: [PATCH] added color for lock --- apps/nspanel-lovelace-ui/luibackend/pages.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 6cf79556..ffb12a46 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -24,7 +24,7 @@ class LuiPagesGen(object): attr = entity.attributes default_color_on = rgb_dec565([253, 216, 53]) default_color_off = rgb_dec565([68, 115, 158]) - icon_color = default_color_on if entity.state == "on" else default_color_off + icon_color = default_color_on if entity.state in ["on", "unlocked"] else default_color_off if "rgb_color" in attr: color = attr.rgb_color @@ -173,8 +173,9 @@ class LuiPagesGen(object): return f"~button~{entityId}~{icon_id}~17299~{name}~{text}" if entityType == "lock": icon_id = get_icon_id_ha("lock", state=entity.state, overwrite=icon) + icon_color = self.get_entity_color(entity) text = get_translation(self._locale,"lock") if entity.state == "unlocked" else get_translation(self._locale,"lock") - return f"~button~{entityId}~{icon_id}~17299~{name}~{text}" + return f"~button~{entityId}~{icon_id}~{icon_color}~{name}~{text}" if entityType == "number": icon_id = get_icon_id_ha("number", overwrite=icon) min_v = entity.attributes.get("min", 0)