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

This commit is contained in:
joBr99
2022-03-29 07:45:16 +00:00
committed by GitHub Actions
parent 09f6580065
commit a7cb3799aa
15 changed files with 1255 additions and 1478 deletions

View File

@@ -346,6 +346,72 @@ Picture p0
Disable release event after dragging: 0
Send Component ID : disabled
Slider hSlider1
Attributes
ID : 74
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Position : 50
Upper range limit : 100
Lower range limit : 0
Slider hSlider2
Attributes
ID : 75
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Position : 50
Upper range limit : 100
Lower range limit : 0
Slider hSlider3
Attributes
ID : 76
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Position : 50
Upper range limit : 100
Lower range limit : 0
Slider hSlider4
Attributes
ID : 77
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Position : 50
Upper range limit : 100
Lower range limit : 0
Slider hSlider5
Attributes
ID : 78
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Position : 50
Upper range limit : 100
Lower range limit : 0
Slider hSlider6
Attributes
ID : 79
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Position : 50
Upper range limit : 100
Lower range limit : 0
Button bDown1
Attributes
ID : 11
@@ -671,13 +737,7 @@ Button bPrev
Events
Touch Press Event
nPage=nPage-1
//page open event
// event,pageOpen,cardEntities,pageNumber
// craft command
// convert pageNumber and write to tTmp
covx nPage,tTmp.txt,0,0
tSend.txt="event,pageOpen,"+tTmp.txt
tSend.txt="event,buttonPress2,cardEntities,bPrev"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -703,13 +763,7 @@ Button bNext
Events
Touch Press Event
nPage=nPage+1
//page open event
// event,pageOpen,cardEntities,pageNumber
// craft command
// convert pageNumber and write to tTmp
covx nPage,tTmp.txt,0,0
tSend.txt="event,pageOpen,"+tTmp.txt
tSend.txt="event,buttonPress2,cardEntities,bNext"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -1878,6 +1932,238 @@ 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
}else
{
// change icon
spstr strCommand.txt,tTmp.txt,",",29
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon5.txt,sys0,1
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
}
if(type5.txt=="light")
{
vis bUp5,0
vis bStop5,0
vis bDown5,0
vis btOnOff5,1
vis bText5,0
vis hSlider5,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
// 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
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
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
// get config (optional Value) (use bText as variable)
spstr strCommand.txt,bText5.txt,",",32
//first value is current value
spstr bText5.txt,tTmp.txt,"|",1
covx tTmp.txt,sys0,0,0
hSlider5.val=sys0
//second value is min value
spstr bText5.txt,tTmp.txt,"|",2
covx tTmp.txt,sys0,0,0
hSlider5.minval=sys0
//third value is max value
spstr bText5.txt,tTmp.txt,"|",3
covx tTmp.txt,sys0,0,0
hSlider5.maxval=sys0
}
// get Type
spstr strCommand.txt,type6.txt,",",33
// get internal name
spstr strCommand.txt,entn6.txt,",",34
if(type6.txt=="delete"||type6.txt=="")
{
vis bUp6,0
vis bStop6,0
vis bDown6,0
vis btOnOff6,0
vis tEntity6,0
vis tIcon6,0
vis bText6,0
vis hSlider6,0
}else
{
// change icon
spstr strCommand.txt,tTmp.txt,",",35
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon6.txt,sys0,1
vis tIcon6,1
// change icon color
spstr strCommand.txt,tTmp.txt,",",36
covx tTmp.txt,sys0,0,0
tIcon6.pco=sys0
// set name
spstr strCommand.txt,tEntity6.txt,",",37
vis tEntity6,1
}
if(type6.txt=="shutter")
{
vis bUp6,1
vis bStop6,1
vis bDown6,1
vis btOnOff6,0
vis bText6,0
vis hSlider6,0
}
if(type6.txt=="light")
{
vis bUp6,0
vis bStop6,0
vis bDown6,0
vis btOnOff6,1
vis bText6,0
vis hSlider6,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",38
covx tTmp.txt,sys0,0,0
btOnOff6.val=sys0
}
if(type6.txt=="switch")
{
vis bUp6,0
vis bStop6,0
vis bDown6,0
vis btOnOff6,1
vis bText6,0
vis hSlider6,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",38
covx tTmp.txt,sys0,0,0
btOnOff6.val=sys0
}
if(type6.txt=="text")
{
vis bUp6,0
vis bStop6,0
vis bDown6,0
vis btOnOff6,0
vis bText6,1
tsw bText6,0
vis hSlider6,0
bText6.pco=65535
bText6.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText6.txt,",",38
}
if(type6.txt=="button")
{
vis bUp6,0
vis bStop6,0
vis bDown6,0
vis btOnOff6,0
vis bText6,1
tsw bText6,1
vis hSlider6,0
bText6.pco=1374
bText6.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText6.txt,",",38
}
if(type6.txt=="number")
{
vis bUp6,0
vis bStop6,0
vis bDown6,0
vis btOnOff6,0
vis bText6,0
tsw bText6,0
vis hSlider6,1
// get config (optional Value) (use bText as variable)
spstr strCommand.txt,bText6.txt,",",38
//first value is current value
spstr bText6.txt,tTmp.txt,"|",1
covx tTmp.txt,sys0,0,0
hSlider6.val=sys0
//second value is min value
spstr bText6.txt,tTmp.txt,"|",2
covx tTmp.txt,sys0,0,0
hSlider6.minval=sys0
//third value is max value
spstr bText6.txt,tTmp.txt,"|",3
covx tTmp.txt,sys0,0,0
hSlider6.maxval=sys0
}
}
if(tInstruction.txt=="pageType")
{