This commit is contained in:
Johannes
2023-04-18 20:12:03 +02:00
committed by GitHub
parent 443d53f9c3
commit 5f97824e36

View File

@@ -6903,7 +6903,10 @@ def get_icon_id(ma_name):
if "text:" in ma_name:
return ma_name.replace("text:","")
if "ha:" in ma_name:
return apis.ha_api.render_template(ma_name.replace("ha:",""))
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)
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:","")