changed entities page message format (add nextion2text)

This commit is contained in:
joBr99
2022-03-19 12:36:24 +00:00
committed by GitHub Actions
parent 91434bfdd3
commit 9267e7be4e
3 changed files with 333 additions and 348 deletions

View File

@@ -1971,352 +1971,337 @@ Timer tmSerial
}
if(tInstruction.txt=="entityUpd")
{
// command format: entityUpd,id,icon,name,type,optionalValue
// write id to tId (debug output, but used as variable here, ui elements will be disabled by default)
spstr strCommand.txt,tId.txt,",",1
// id 1
if(tId.txt=="1")
// command format: entityUpd[,type,internalName,iconId,displayName,optionalValue]x4
// get Type
spstr strCommand.txt,type1.txt,",",1
// get internal name
spstr strCommand.txt,entn1.txt,",",2
if(type1.txt=="delete")
{
// get Type
spstr strCommand.txt,type1.txt,",",2
// get internal name
spstr strCommand.txt,entn1.txt,",",3
if(type1.txt=="delete")
{
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,0
vis tEntity1,0
vis tIcon1,0
vis bText1,0
}else
{
// change icon
spstr strCommand.txt,tTmp.txt,",",4
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon1.txt,sys0,1
vis tIcon1,1
// set name
spstr strCommand.txt,tEntity1.txt,",",5
vis tEntity1,1
}
if(type1.txt=="shutter")
{
vis bUp1,1
vis bStop1,1
vis bDown1,1
vis btOnOff1,0
vis bText1,0
}
if(type1.txt=="light")
{
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,1
vis bText1,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
}
if(type1.txt=="switch")
{
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,1
vis bText1,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
}
if(type1.txt=="text")
{
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,0
vis bText1,1
tsw bText1,0
bText1.pco=65535
bText1.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText1.txt,",",6
}
if(type1.txt=="button")
{
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,0
vis bText1,1
tsw bText1,1
bText1.pco=1374
bText1.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText1.txt,",",6
}
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,0
vis tEntity1,0
vis tIcon1,0
vis bText1,0
}else
{
// change icon
spstr strCommand.txt,tTmp.txt,",",3
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon1.txt,sys0,1
vis tIcon1,1
// set name
spstr strCommand.txt,tEntity1.txt,",",4
vis tEntity1,1
}
// id 2
if(tId.txt=="2")
if(type1.txt=="shutter")
{
// get Type
spstr strCommand.txt,type2.txt,",",2
// get internal name
spstr strCommand.txt,entn2.txt,",",3
if(type2.txt=="delete")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,0
vis tEntity2,0
vis tIcon2,0
vis bText2,0
}else
{
//change icon
spstr strCommand.txt,tTmp.txt,",",4
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon2.txt,sys0,1
vis tIcon2,1
// set name
spstr strCommand.txt,tEntity2.txt,",",5
vis tEntity2,1
}
if(type2.txt=="shutter")
{
vis bUp2,1
vis bStop2,1
vis bDown2,1
vis btOnOff2,0
vis bText2,0
}
if(type2.txt=="light")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,1
vis bText2,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff2.val=sys0
}
if(type2.txt=="switch")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,1
vis bText2,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff2.val=sys0
}
if(type2.txt=="text")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,0
vis bText2,1
tsw bText2,0
bText2.pco=65535
bText2.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText2.txt,",",6
}
if(type2.txt=="button")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,0
vis bText2,1
tsw bText2,1
bText2.pco=1374
bText2.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText2.txt,",",6
}
vis bUp1,1
vis bStop1,1
vis bDown1,1
vis btOnOff1,0
vis bText1,0
}
// id 3
if(tId.txt=="3")
if(type1.txt=="light")
{
// get Type
spstr strCommand.txt,type3.txt,",",2
// get internal name
spstr strCommand.txt,entn3.txt,",",3
if(type3.txt=="delete")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis btOnOff3,0
vis tEntity3,0
vis tIcon3,0
vis bText3,0
}else
{
//change icon
spstr strCommand.txt,tTmp.txt,",",4
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon3.txt,sys0,1
vis tIcon3,1
// set name
spstr strCommand.txt,tEntity3.txt,",",5
vis tEntity3,1
}
if(type3.txt=="shutter")
{
vis bUp3,1
vis bStop3,1
vis bDown3,1
vis btOnOff3,0
vis bText3,0
}
if(type3.txt=="light")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis bText3,0
vis btOnOff3,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff3.val=sys0
}
if(type3.txt=="switch")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis bText3,0
vis btOnOff3,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff3.val=sys0
}
if(type3.txt=="text")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis btOnOff3,0
vis bText3,1
tsw bText3,0
bText3.pco=65535
bText3.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText3.txt,",",6
}
if(type3.txt=="button")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis btOnOff3,0
vis bText3,1
tsw bText3,1
bText3.pco=1374
bText3.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText3.txt,",",6
}
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,1
vis bText1,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",5
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
}
// id 2
if(tId.txt=="4")
if(type1.txt=="switch")
{
// get Type
spstr strCommand.txt,type4.txt,",",2
// get internal name
spstr strCommand.txt,entn4.txt,",",3
if(type4.txt=="delete")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis btOnOff4,0
vis tEntity4,0
vis tIcon4,0
vis bText4,0
}else
{
//change icon
spstr strCommand.txt,tTmp.txt,",",4
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon4.txt,sys0,1
vis tIcon4,1
// set name
spstr strCommand.txt,tEntity4.txt,",",5
vis tEntity4,1
}
if(type4.txt=="shutter")
{
vis bUp4,1
vis bStop4,1
vis bDown4,1
vis btOnOff4,0
vis bText4,0
}
if(type4.txt=="light")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis bText4,0
vis btOnOff4,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff4.val=sys0
}
if(type4.txt=="switch")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis bText4,0
vis btOnOff4,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff4.val=sys0
}
if(type4.txt=="text")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis btOnOff4,0
vis bText4,1
tsw bText4,0
bText4.pco=65535
bText4.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText4.txt,",",6
}
if(type4.txt=="button")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis btOnOff4,0
vis bText4,1
tsw bText4,1
bText4.pco=1374
bText4.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText4.txt,",",6
}
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,1
vis bText1,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",5
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
}
if(type1.txt=="text")
{
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,0
vis bText1,1
tsw bText1,0
bText1.pco=65535
bText1.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText1.txt,",",5
}
if(type1.txt=="button")
{
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,0
vis bText1,1
tsw bText1,1
bText1.pco=1374
bText1.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText1.txt,",",5
}
// id2
// get Type
spstr strCommand.txt,type2.txt,",",6
// get internal name
spstr strCommand.txt,entn2.txt,",",7
if(type2.txt=="delete")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,0
vis tEntity2,0
vis tIcon2,0
vis bText2,0
}else
{
//change icon
spstr strCommand.txt,tTmp.txt,",",8
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon2.txt,sys0,1
vis tIcon2,1
// set name
spstr strCommand.txt,tEntity2.txt,",",9
vis tEntity2,1
}
if(type2.txt=="shutter")
{
vis bUp2,1
vis bStop2,1
vis bDown2,1
vis btOnOff2,0
vis bText2,0
}
if(type2.txt=="light")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,1
vis bText2,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",10
covx tTmp.txt,sys0,0,0
btOnOff2.val=sys0
}
if(type2.txt=="switch")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,1
vis bText2,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",10
covx tTmp.txt,sys0,0,0
btOnOff2.val=sys0
}
if(type2.txt=="text")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,0
vis bText2,1
tsw bText2,0
bText2.pco=65535
bText2.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText2.txt,",",10
}
if(type2.txt=="button")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,0
vis bText2,1
tsw bText2,1
bText2.pco=1374
bText2.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText2.txt,",",10
}
// id3
// get Type
spstr strCommand.txt,type3.txt,",",11
// get internal name
spstr strCommand.txt,entn3.txt,",",12
if(type3.txt=="delete")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis btOnOff3,0
vis tEntity3,0
vis tIcon3,0
vis bText3,0
}else
{
//change icon
spstr strCommand.txt,tTmp.txt,",",13
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon3.txt,sys0,1
vis tIcon3,1
// set name
spstr strCommand.txt,tEntity3.txt,",",14
vis tEntity3,1
}
if(type3.txt=="shutter")
{
vis bUp3,1
vis bStop3,1
vis bDown3,1
vis btOnOff3,0
vis bText3,0
}
if(type3.txt=="light")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis bText3,0
vis btOnOff3,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",15
covx tTmp.txt,sys0,0,0
btOnOff3.val=sys0
}
if(type3.txt=="switch")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis bText3,0
vis btOnOff3,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",15
covx tTmp.txt,sys0,0,0
btOnOff3.val=sys0
}
if(type3.txt=="text")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis btOnOff3,0
vis bText3,1
tsw bText3,0
bText3.pco=65535
bText3.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText3.txt,",",15
}
if(type3.txt=="button")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis btOnOff3,0
vis bText3,1
tsw bText3,1
bText3.pco=1374
bText3.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText3.txt,",",15
}
// id4
// get Type
spstr strCommand.txt,type4.txt,",",16
// get internal name
spstr strCommand.txt,entn4.txt,",",17
if(type4.txt=="delete")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis btOnOff4,0
vis tEntity4,0
vis tIcon4,0
vis bText4,0
}else
{
//change icon
spstr strCommand.txt,tTmp.txt,",",18
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon4.txt,sys0,1
vis tIcon4,1
// set name
spstr strCommand.txt,tEntity4.txt,",",19
vis tEntity4,1
}
if(type4.txt=="shutter")
{
vis bUp4,1
vis bStop4,1
vis bDown4,1
vis btOnOff4,0
vis bText4,0
}
if(type4.txt=="light")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis bText4,0
vis btOnOff4,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",20
covx tTmp.txt,sys0,0,0
btOnOff4.val=sys0
}
if(type4.txt=="switch")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis bText4,0
vis btOnOff4,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",20
covx tTmp.txt,sys0,0,0
btOnOff4.val=sys0
}
if(type4.txt=="text")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis btOnOff4,0
vis bText4,1
tsw bText4,0
bText4.pco=65535
bText4.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText4.txt,",",20
}
if(type4.txt=="button")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis btOnOff4,0
vis bText4,1
tsw bText4,1
bText4.pco=1374
bText4.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText4.txt,",",20
}
}
if(tInstruction.txt=="pageType")

View File

@@ -38,25 +38,25 @@ pageSwipeTest
18 Component(s)
62 Line(s) of event code
44 Unique line(s) of event code
screensaver
25 Component(s)
152 Line(s) of event code
118 Unique line(s) of event code
cardThermo
42 Component(s)
450 Line(s) of event code
220 Unique line(s) of event code
cardEntities
55 Component(s)
824 Line(s) of event code
313 Unique line(s) of event code
811 Line(s) of event code
312 Unique line(s) of event code
cardAlarm
28 Component(s)
159 Line(s) of event code
105 Unique line(s) of event code
screensaver
25 Component(s)
152 Line(s) of event code
118 Unique line(s) of event code
Total
13 Page(s)
302 Component(s)
2665 Line(s) of event code
684 Unique line(s) of event code
2652 Line(s) of event code
682 Unique line(s) of event code

View File

@@ -730,7 +730,7 @@ Timer tmSerial
//pagenumber
spstr strCommand.txt,tTmp.txt,"?",1
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,nPage,sys0,1
nPage=sys0
//don't send current page number, wake will do
}
if(tInstruction.txt=="pageType")