Merge branch 'main' of https://github.com/joBr99/nspanel-lovelace-ui (add nextion2text)

This commit is contained in:
joBr99
2022-06-23 20:32:25 +00:00
committed by github-actions[bot]
parent 3fbdf55718
commit 9c7dabee6b
28 changed files with 509 additions and 1282 deletions

View File

@@ -3243,169 +3243,6 @@ Timer tmSerial
covx tTmp.txt,sys0,0,0
hSlider4.maxval=sys0
}
// get Type
spstr strCommand.txt,type5.txt,"~",27
// get internal name
spstr strCommand.txt,entn5.txt,"~",28
if(type5.txt=="delete"||type5.txt=="")
{
vis bUp5,0
vis bStop5,0
vis bDown5,0
vis btOnOff5,0
vis tEntity5,0
vis tIcon5,0
vis bText5,0
vis hSlider5,0
vis nNum5,0
}else
{
// change icon
spstr strCommand.txt,tIcon5.txt,"~",29
vis tIcon5,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",30
covx tTmp.txt,sys0,0,0
tIcon5.pco=sys0
// set name
spstr strCommand.txt,tEntity5.txt,"~",31
vis tEntity5,1
}
if(type5.txt=="shutter")
{
vis bUp5,1
vis bStop5,1
vis bDown5,1
vis btOnOff5,0
vis bText5,0
vis hSlider5,0
vis nNum5,0
// get Button State (optional Value)
spstr strCommand.txt,tId.txt,"~",32
// up button
spstr tId.txt,tTmp.txt,"|",3
if(tTmp.txt=="disable")
{
bUp5.pco=27501
spstr tId.txt,bUp5.txt,"|",0
tsw bUp5,0
}else if(tTmp.txt=="enable")
{
bUp5.pco=65535
spstr tId.txt,bUp5.txt,"|",0
tsw bUp5,1
}
// stop button
spstr tId.txt,tTmp.txt,"|",4
if(tTmp.txt=="disable")
{
bStop5.pco=27501
spstr tId.txt,bStop5.txt,"|",1
tsw bStop5,0
}else if(tTmp.txt=="enable")
{
bStop5.pco=65535
spstr tId.txt,bStop5.txt,"|",1
tsw bStop5,1
}
// down button
spstr tId.txt,tTmp.txt,"|",5
if(tTmp.txt=="disable")
{
bDown5.pco=27501
spstr tId.txt,bDown5.txt,"|",2
tsw bDown5,0
}else if(tTmp.txt=="enable")
{
bDown5.pco=65535
spstr tId.txt,bDown5.txt,"|",2
tsw bDown5,1
}
}
if(type5.txt=="light")
{
vis bUp5,0
vis bStop5,0
vis bDown5,0
vis btOnOff5,1
vis bText5,0
vis hSlider5,0
vis nNum5,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,"~",32
covx tTmp.txt,sys0,0,0
btOnOff5.val=sys0
}
if(type5.txt=="switch")
{
vis bUp5,0
vis bStop5,0
vis bDown5,0
vis btOnOff5,1
vis bText5,0
vis hSlider5,0
vis nNum5,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,"~",32
covx tTmp.txt,sys0,0,0
btOnOff5.val=sys0
}
if(type5.txt=="text")
{
vis bUp5,0
vis bStop5,0
vis bDown5,0
vis btOnOff5,0
vis bText5,1
tsw bText5,0
vis hSlider5,0
vis nNum5,0
bText5.pco=65535
bText5.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText5.txt,"~",32
}
if(type5.txt=="button")
{
vis bUp5,0
vis bStop5,0
vis bDown5,0
vis btOnOff5,0
vis bText5,1
tsw bText5,1
vis hSlider5,0
vis nNum5,0
bText5.pco=1374
bText5.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText5.txt,"~",32
}
if(type5.txt=="number")
{
vis bUp5,0
vis bStop5,0
vis bDown5,0
vis btOnOff5,0
vis bText5,0
tsw bText5,0
vis hSlider5,1
vis nNum5,1
// get config (optional Value) (use bText as variable)
spstr strCommand.txt,bText5.txt,"~",32
//first value is current value
spstr bText5.txt,tTmp.txt,"|",0
covx tTmp.txt,sys0,0,0
hSlider5.val=sys0
nNum5.val=sys0
//second value is min value
spstr bText5.txt,tTmp.txt,"|",1
covx tTmp.txt,sys0,0,0
hSlider5.minval=sys0
//third value is max value
spstr bText5.txt,tTmp.txt,"|",2
covx tTmp.txt,sys0,0,0
hSlider5.maxval=sys0
}
}
if(tInstruction.txt=="pageType")
{
@@ -3485,6 +3322,18 @@ Timer tmSerial
spstr strCommand.txt,tTmp.txt,"~",2
covx tTmp.txt,dimValueNormal,0,0
dim=dimValueNormal
// get background color
spstr strCommand.txt,tTmp.txt,"~",3
if(tTmp.txt!="")
{
covx tTmp.txt,defaultBcoColor,0,0
}
// get font color
spstr strCommand.txt,tTmp.txt,"~",4
if(tTmp.txt!="")
{
covx tTmp.txt,defaultFontColor,0,0
}
}
if(tInstruction.txt=="timeout")
{