This commit is contained in:
Johannes
2022-08-30 16:42:50 +02:00
parent 030beb674f
commit 2d53f26ec6
2 changed files with 8 additions and 1 deletions

View File

@@ -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":

View File

@@ -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):