mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-19 22:24:15 +01:00
implements a new icon type that can be used to display home assistant templates
This commit is contained in:
@@ -18,7 +18,12 @@ with open(os.path.join(__location__, "../../../apps/nspanel-lovelace-ui/luibacke
|
||||
f.write(f" '{name}': '{iconchar}',\n")
|
||||
f.write("}\n")
|
||||
f.write("""
|
||||
import apis
|
||||
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:",""))
|
||||
ma_name = ma_name.replace("mdi:","")
|
||||
if ma_name in icons:
|
||||
return icons[ma_name]
|
||||
|
||||
Reference in New Issue
Block a user