mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-20 06:27:01 +01:00
synced changes from eu version
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -26,15 +26,32 @@ def get_icon_id(ma_name):
|
||||
return icons["alert-circle-outline"]
|
||||
""")
|
||||
|
||||
# write documentation file
|
||||
with open(os.path.join(__location__, "../..","icons.md"), 'w') as f:
|
||||
f.write("""
|
||||
# Icons IDs
|
||||
This file contains the Icons IDs included in the display firmware, addressable via serial.
|
||||
|
||||
MD Icon Name | Icon
|
||||
------------ | ----
|
||||
""")
|
||||
# write mapping lib for typescript
|
||||
with open(os.path.join(__location__, "../../../iobroker", "icon_mapping.ts"), 'w') as f:
|
||||
f.write("let iconMap = new Map<string, string>([\n")
|
||||
for icon in icon_metadata:
|
||||
val = icon["name"]
|
||||
f.write(f"mdi:{val} | \n")
|
||||
iconchar = chr(int(icon['hex'], 16))
|
||||
name = icon["name"]
|
||||
f.write(f" [\"{name}\", \"{iconchar}\"],\n")
|
||||
f.write("]);\n")
|
||||
f.write("""
|
||||
function get_icon(ma_name:string):string{
|
||||
if(iconMap.has(ma_name)){
|
||||
return iconMap.get(ma_name);
|
||||
}
|
||||
return iconMap.get("alert-circle-outline");
|
||||
}
|
||||
""");
|
||||
|
||||
# write documentation file
|
||||
#with open(os.path.join(__location__, "../..","icons.md"), 'w') as f:
|
||||
# f.write("""
|
||||
## Icons IDs
|
||||
#This file contains the Icons IDs included in the display firmware, addressable via serial.
|
||||
#
|
||||
#MD Icon Name | Icon
|
||||
#------------ | ----
|
||||
#""")
|
||||
# for icon in icon_metadata:
|
||||
# val = icon["name"]
|
||||
# f.write(f"mdi:{val} | \n")
|
||||
|
||||
Reference in New Issue
Block a user