diff --git a/apps/nspanel-lovelace-ui/luibackend/icons.py b/apps/nspanel-lovelace-ui/luibackend/icons.py index 9b5fbccd..d6f57155 100644 --- a/apps/nspanel-lovelace-ui/luibackend/icons.py +++ b/apps/nspanel-lovelace-ui/luibackend/icons.py @@ -93,6 +93,8 @@ def map_to_mdi_name(ha_type, state=None, device_class="_", cardType=None): return "lightbulb" elif ha_type == "fan": return "fan" + elif ha_type == "person": + return "account" elif ha_type == "vacuum": return "robot-vacuum" elif ha_type == "input_boolean": diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index a4109d50..4856c0c6 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -35,7 +35,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 in ["on", "unlocked", "above_horizon"] else default_color_off + icon_color = default_color_on if entity.state in ["on", "unlocked", "above_horizon", "home"] else default_color_off if ha_type == "alarm_control_panel": if entity.state == "disarmed": @@ -346,6 +346,11 @@ class LuiPagesGen(object): icon_id = get_icon_id_ha(entityType, state=entity.state, overwrite=icon) text = get_translation(self._locale, f"backend.component.sun.state._.{entity.state}") return f"~text~{entityId}~{icon_id}~{icon_color}~{name}~{text}" + if entityType == "person": + icon_id = get_icon_id_ha(entityType, state=entity.state, overwrite=icon) + icon_color = self.get_entity_color(entity, ha_type=entityType, overwrite=colorOverride) + text = get_translation(self._locale, f"backend.component.person.state._.{entity.state}") + return f"~text~{entityId}~{icon_id}~{icon_color}~{name}~{text}" return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~unsupported~" def generate_entities_page(self, navigation, heading, items, cardType):