diff --git a/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/ha_cards.py b/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/ha_cards.py index c5442947..773a1d0f 100644 --- a/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/ha_cards.py +++ b/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/ha_cards.py @@ -37,6 +37,10 @@ class HAEntity(panel_cards.Entity): else: return "~text~iid.404~X~6666~not found~" + if self.icon_overwrite and self.icon_overwrite.startswith("ha:"): + #icon_char = libs.home_assistant.render_template(self.icon_overwrite[3:]) + icon_char = ha_template.render(self.icon_overwrite[3:]) + # HA Entities entity_type_panel = "text" icon_char = ha_icons.get_icon_ha(self.etype, self.state, device_class=self.attributes.get("device_class", None), media_content_type=self.attributes.get("media_content_type", None), overwrite=self.config.get("icon")) @@ -212,11 +216,6 @@ class HAEntity(panel_cards.Entity): case _: name = "unsupported" - - if self.icon_overwrite and self.icon_overwrite.startswith("ha:"): - #icon_char = libs.home_assistant.render_template(self.icon_overwrite[3:]) - icon_char = ha_template.render(self.icon_overwrite[3:]) - if self.value_overwrite and self.value_overwrite.startswith("ha:"): value = ha_template.render(self.value_overwrite[3:]) diff --git a/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/libs/icon_mapping.py b/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/libs/icon_mapping.py index 044580d4..b6398634 100644 --- a/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/libs/icon_mapping.py +++ b/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/libs/icon_mapping.py @@ -6913,6 +6913,7 @@ def get_icon_id(ma_name): if isinstance(ma_name, str): ma_name = re.sub(r'.+?<\/I>', get_icon_id, ma_name) print(f"test123d {ma_name}") + return ma_name ma_name = ma_name.replace("mdi:", "") if ma_name in icons: diff --git a/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/panel.py b/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/panel.py index 25e143f1..fccbb628 100644 --- a/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/panel.py +++ b/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/panel.py @@ -96,7 +96,7 @@ class LovelaceUIPanel: return self.hidden_cards[iid] def ha_event_callback(self, entity_id): - logging.debug(f"{self.name} {entity_id} updated/state changed") + #logging.debug(f"{self.name} {entity_id} updated/state changed") if entity_id in self.current_card.get_entities(): self.render_current_page(requested=True)