mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-19 22:24:15 +01:00
implement way to change icon font changes on entities
This commit is contained in:
@@ -7,7 +7,7 @@ head = sharedhead + """
|
|||||||
""" + navigation
|
""" + navigation
|
||||||
print(head)
|
print(head)
|
||||||
start = 14
|
start = 14
|
||||||
for i in range(1,7):
|
for i in range(1,9):
|
||||||
idxstart = start + (i-1)*6
|
idxstart = start + (i-1)*6
|
||||||
item = f"""
|
item = f"""
|
||||||
// get Type
|
// get Type
|
||||||
@@ -22,6 +22,19 @@ for i in range(1,7):
|
|||||||
{{
|
{{
|
||||||
// change icon
|
// change icon
|
||||||
spstr strCommand.txt,bEntity{i}.txt,"~",{idxstart+2}
|
spstr strCommand.txt,bEntity{i}.txt,"~",{idxstart+2}
|
||||||
|
|
||||||
|
// way to get force font adjustment
|
||||||
|
strlen bEntity{i}.txt,sys0
|
||||||
|
//check 2nd last char for ¬
|
||||||
|
substr bEntity{i}.txt,tTmp.txt,sys0-2,1
|
||||||
|
if(tTmp.txt=="¬")
|
||||||
|
{{
|
||||||
|
substr bEntity{i}.txt,tTmp.txt,sys0-1,1
|
||||||
|
covx tTmp.txt,sys1,0,0
|
||||||
|
bEntity{i}.font=sys1
|
||||||
|
substr bEntity{i}.txt,bEntity{i}.txt,0,sys0-2
|
||||||
|
}}
|
||||||
|
|
||||||
vis bEntity{i},1
|
vis bEntity{i},1
|
||||||
// change icon color
|
// change icon color
|
||||||
spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
||||||
|
|||||||
@@ -71,6 +71,19 @@ for i in range(1,7):
|
|||||||
// change icon
|
// change icon
|
||||||
spstr strCommand.txt,bEntity{i}.txt,"~",{idxstart+2}
|
spstr strCommand.txt,bEntity{i}.txt,"~",{idxstart+2}
|
||||||
vis bEntity{i},1
|
vis bEntity{i},1
|
||||||
|
|
||||||
|
// way to get force font adjustment
|
||||||
|
strlen bEntity{i}.txt,sys0
|
||||||
|
//check 2nd last char for ¬
|
||||||
|
substr bEntity{i}.txt,tTmp.txt,sys0-2,1
|
||||||
|
if(tTmp.txt=="¬")
|
||||||
|
{{
|
||||||
|
substr bEntity{i}.txt,tTmp.txt,sys0-1,1
|
||||||
|
covx tTmp.txt,sys1,0,0
|
||||||
|
bEntity{i}.font=sys1
|
||||||
|
substr bEntity{i}.txt,bEntity{i}.txt,0,sys0-2
|
||||||
|
}}
|
||||||
|
|
||||||
// change icon color
|
// change icon color
|
||||||
spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
||||||
covx tTmp.txt,sys0,0,0
|
covx tTmp.txt,sys0,0,0
|
||||||
@@ -79,6 +92,7 @@ for i in range(1,7):
|
|||||||
spstr strCommand.txt,tEntity{i}.txt,"~",{idxstart+4}
|
spstr strCommand.txt,tEntity{i}.txt,"~",{idxstart+4}
|
||||||
vis tEntity{i},1
|
vis tEntity{i},1
|
||||||
}}
|
}}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
print(item)
|
print(item)
|
||||||
foot = """
|
foot = """
|
||||||
|
|||||||
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
Reference in New Issue
Block a user