diff --git a/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py b/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py
index 6323963a..65f63eb7 100644
--- a/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py
+++ b/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py
@@ -6900,15 +6900,19 @@ icons = {
import apis
def get_icon_id(ma_name):
+ if isinstance(ma_name, re.Match):
+ ma_name = ma_name.group(0).replace('', '').replace('', '')
+
if "text:" in ma_name:
return ma_name.replace("text:","")
if "ha:" in ma_name:
splitted_string = ma_name.replace("ha:","").rpartition('}')
template_string = f"{splitted_string[0]}{splitted_string[1]}"
templates_result = apis.ha_api.render_template(template_string)
+ if isinstance(templates_result, str):
+ templates_result = re.sub(r".+?<\/I>", get_icon_id, templates_result)
return f"{templates_result}{splitted_string[2]}"
- if "ha-i:" in ma_name:
- ma_name = apis.ha_api.render_template(ma_name.replace("ha-i:",""))
+
ma_name = ma_name.replace("mdi:","")
if ma_name in icons:
return icons[ma_name]