mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-01-06 14:45:46 +01:00
icons for shutters are now configurable (add nextion2text)
This commit is contained in:
committed by
github-actions[bot]
parent
8228ecb6c9
commit
bb65a3cc54
@@ -1279,25 +1279,40 @@ Timer tmSerial
|
||||
vis nNum1,0
|
||||
// get Button State (optional Value)
|
||||
spstr strCommand.txt,tId.txt,"~",8
|
||||
// up button
|
||||
spstr tId.txt,tTmp.txt,"|",0
|
||||
if(tTmp.txt=="0")
|
||||
{
|
||||
bUp1.pco=27501
|
||||
tsw bUp1,0
|
||||
}else
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bUp1.pco=65535
|
||||
tsw bUp1,1
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
bUp1.pco=27501
|
||||
tsw bUp1,0
|
||||
}
|
||||
// stop button
|
||||
spstr tId.txt,tTmp.txt,"|",1
|
||||
if(tTmp.txt=="0")
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bStop1.pco=65535
|
||||
bStop1.txt=tTmp.txt
|
||||
tsw bStop1,1
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
bStop1.pco=27501
|
||||
tsw bStop1,0
|
||||
}
|
||||
// down button
|
||||
spstr tId.txt,tTmp.txt,"|",2
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bDown1.pco=65535
|
||||
bDown1.txt=tTmp.txt
|
||||
tsw bDown1,1
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
bDown1.pco=27501
|
||||
tsw bDown1,0
|
||||
}else
|
||||
{
|
||||
bDown1.pco=65535
|
||||
tsw bDown1,1
|
||||
}
|
||||
}
|
||||
if(type1.txt=="light")
|
||||
@@ -1423,25 +1438,40 @@ Timer tmSerial
|
||||
vis nNum2,0
|
||||
// get Button State (optional Value)
|
||||
spstr strCommand.txt,tId.txt,"~",14
|
||||
// up button
|
||||
spstr tId.txt,tTmp.txt,"|",0
|
||||
if(tTmp.txt=="0")
|
||||
{
|
||||
bUp2.pco=27501
|
||||
tsw bUp2,0
|
||||
}else
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bUp2.pco=65535
|
||||
tsw bUp2,1
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
bUp2.pco=27501
|
||||
tsw bUp2,0
|
||||
}
|
||||
// stop button
|
||||
spstr tId.txt,tTmp.txt,"|",1
|
||||
if(tTmp.txt=="0")
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bStop2.pco=65535
|
||||
bStop2.txt=tTmp.txt
|
||||
tsw bStop2,1
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
bStop2.pco=27501
|
||||
tsw bStop2,0
|
||||
}
|
||||
// down button
|
||||
spstr tId.txt,tTmp.txt,"|",2
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bDown2.pco=65535
|
||||
bDown2.txt=tTmp.txt
|
||||
tsw bDown2,1
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
bDown2.pco=27501
|
||||
tsw bDown2,0
|
||||
}else
|
||||
{
|
||||
bDown2.pco=65535
|
||||
tsw bDown2,1
|
||||
}
|
||||
}
|
||||
if(type2.txt=="light")
|
||||
@@ -1567,25 +1597,40 @@ Timer tmSerial
|
||||
vis nNum3,0
|
||||
// get Button State (optional Value)
|
||||
spstr strCommand.txt,tId.txt,"~",20
|
||||
// up button
|
||||
spstr tId.txt,tTmp.txt,"|",0
|
||||
if(tTmp.txt=="0")
|
||||
{
|
||||
bUp3.pco=27501
|
||||
tsw bUp3,0
|
||||
}else
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bUp3.pco=65535
|
||||
tsw bUp3,1
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
bUp3.pco=27501
|
||||
tsw bUp3,0
|
||||
}
|
||||
// stop button
|
||||
spstr tId.txt,tTmp.txt,"|",1
|
||||
if(tTmp.txt=="0")
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bStop3.pco=65535
|
||||
bStop3.txt=tTmp.txt
|
||||
tsw bStop3,1
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
bStop3.pco=27501
|
||||
tsw bStop3,0
|
||||
}
|
||||
// down button
|
||||
spstr tId.txt,tTmp.txt,"|",2
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bDown3.pco=65535
|
||||
bDown3.txt=tTmp.txt
|
||||
tsw bDown3,1
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
bDown3.pco=27501
|
||||
tsw bDown3,0
|
||||
}else
|
||||
{
|
||||
bDown3.pco=65535
|
||||
tsw bDown3,1
|
||||
}
|
||||
}
|
||||
if(type3.txt=="light")
|
||||
@@ -1711,25 +1756,40 @@ Timer tmSerial
|
||||
vis nNum4,0
|
||||
// get Button State (optional Value)
|
||||
spstr strCommand.txt,tId.txt,"~",26
|
||||
// up button
|
||||
spstr tId.txt,tTmp.txt,"|",0
|
||||
if(tTmp.txt=="0")
|
||||
{
|
||||
bUp4.pco=27501
|
||||
tsw bUp4,0
|
||||
}else
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bUp4.pco=65535
|
||||
tsw bUp4,1
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
bUp4.pco=27501
|
||||
tsw bUp4,0
|
||||
}
|
||||
// stop button
|
||||
spstr tId.txt,tTmp.txt,"|",1
|
||||
if(tTmp.txt=="0")
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bStop4.pco=65535
|
||||
bStop4.txt=tTmp.txt
|
||||
tsw bStop4,1
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
bStop4.pco=27501
|
||||
tsw bStop4,0
|
||||
}
|
||||
// down button
|
||||
spstr tId.txt,tTmp.txt,"|",2
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bDown4.pco=65535
|
||||
bDown4.txt=tTmp.txt
|
||||
tsw bDown4,1
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
bDown4.pco=27501
|
||||
tsw bDown4,0
|
||||
}else
|
||||
{
|
||||
bDown4.pco=65535
|
||||
tsw bDown4,1
|
||||
}
|
||||
}
|
||||
if(type4.txt=="light")
|
||||
|
||||
@@ -339,12 +339,63 @@ Timer tmSerial
|
||||
{
|
||||
// get Position value
|
||||
spstr strCommand.txt,tTmp.txt,"~",1
|
||||
covx tTmp.txt,sys0,0,0
|
||||
hPosition.val=sys0
|
||||
if(tTmp.txt=="disable")
|
||||
{
|
||||
vis tPosHeading,0
|
||||
vis hPosition,0
|
||||
}else
|
||||
{
|
||||
covx tTmp.txt,sys0,0,0
|
||||
hPosition.val=sys0
|
||||
vis tPosHeading,1
|
||||
vis hPosition,1
|
||||
}
|
||||
// set tinfo1 text
|
||||
spstr strCommand.txt,tInfo1.txt,"~",2
|
||||
// set tPosHeading (localization)
|
||||
spstr strCommand.txt,tPosHeading.txt,"~",3
|
||||
// set tIcon1
|
||||
spstr strCommand.txt,tTmp.txt,"~",4
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
tIcon1.txt=tTmp.txt
|
||||
}
|
||||
// set icon bUp
|
||||
spstr strCommand.txt,tTmp.txt,"~",5
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bUp1.txt=tTmp.txt
|
||||
tsw bUp1,1
|
||||
bUp1.pco=65535
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
tsw bUp1,0
|
||||
bUp1.pco=27501
|
||||
}
|
||||
// set icon bStop
|
||||
spstr strCommand.txt,tTmp.txt,"~",6
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bStop1.txt=tTmp.txt
|
||||
tsw bStop1,1
|
||||
bStop1.pco=65535
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
tsw bStop1,0
|
||||
bStop1.pco=27501
|
||||
}
|
||||
// set icon bDown
|
||||
spstr strCommand.txt,tTmp.txt,"~",7
|
||||
if(tTmp.txt!="")
|
||||
{
|
||||
bDown1.txt=tTmp.txt
|
||||
tsw bDown1,1
|
||||
bDown1.pco=65535
|
||||
}else if(tTmp.txt!="disable")
|
||||
{
|
||||
tsw bDown1,0
|
||||
bDown1.pco=27501
|
||||
}
|
||||
}
|
||||
if(tInstruction.txt=="dimmode")
|
||||
{
|
||||
@@ -437,15 +488,6 @@ Timer tmSerial
|
||||
// next character
|
||||
bufferPos++
|
||||
}
|
||||
if(bufferPos==usize)
|
||||
{
|
||||
// copy whole buffer to t1.txt, for debugging
|
||||
//ucopy t2.txt,0,usize,0
|
||||
// ucopy n2.val,0,usize,0
|
||||
// clear whole buffer
|
||||
//code_c
|
||||
//bufferPos=0
|
||||
}
|
||||
}
|
||||
|
||||
TouchCap tc0
|
||||
|
||||
Reference in New Issue
Block a user