mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-21 15:04:24 +01:00
fix icon rendering
This commit is contained in:
@@ -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:])
|
||||
|
||||
|
||||
@@ -6913,6 +6913,7 @@ def get_icon_id(ma_name):
|
||||
if isinstance(ma_name, str):
|
||||
ma_name = re.sub(r'<I>.+?<\/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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user