Since v3.4, the info about entity_id shown was going all the way to Nextion and then sent back in the json return, however this requires a long (100-char) global var and the way it was implemented, it was one of those per settings page, as climate should be also recorded at the same time in case the embedded climate was installed. This was taking too much memory, so I've moved this info to a global variable (string) in ESPHome. There is now lots of space for code cleaning (and still pending to do the same with climate entity, as it could be only a bool to inform if embedded), but this brings the functionality. This enabled the return to global for some components, so it probably solves #1031
399 lines
9.5 KiB
Plaintext
399 lines
9.5 KiB
Plaintext
Page keyb_num
|
|
Attributes
|
|
ID : 0
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID : disabled
|
|
Locked : no
|
|
Swide up page ID : disabled
|
|
Swide down page ID : disabled
|
|
Swide left page ID : disabled
|
|
Swide right page ID: disabled
|
|
|
|
Events
|
|
Preinitialize Event
|
|
if(api==0)
|
|
{
|
|
page page_id.val
|
|
}else
|
|
{
|
|
printh 92
|
|
prints "nspanelevent",0
|
|
printh 00
|
|
prints "{\"page\": \"keyb_num\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
|
printh 00
|
|
printh FF FF FF
|
|
}
|
|
|
|
Touch Press Event
|
|
printh 91
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints rand,0
|
|
printh FF FF FF
|
|
|
|
Touch Release Event
|
|
printh 91
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints rand,0
|
|
printh FF FF FF
|
|
|
|
Variable (int32) page_id
|
|
Attributes
|
|
ID : 17
|
|
Scope: local
|
|
Value: 0
|
|
|
|
Variable (string) key
|
|
Attributes
|
|
ID : 19
|
|
Scope : local
|
|
Text :
|
|
Max. Text Size: 10
|
|
|
|
Variable (string) entity
|
|
Attributes
|
|
ID : 20
|
|
Scope : local
|
|
Text :
|
|
Max. Text Size: 100
|
|
|
|
Variable (string) domain
|
|
Attributes
|
|
ID : 21
|
|
Scope : local
|
|
Text : alarm
|
|
Max. Text Size: 10
|
|
|
|
Variable (string) aux
|
|
Attributes
|
|
ID : 22
|
|
Scope : local
|
|
Text :
|
|
Max. Text Size: 255
|
|
|
|
Variable (string) value
|
|
Attributes
|
|
ID : 23
|
|
Scope : local
|
|
Text :
|
|
Max. Text Size: 10
|
|
|
|
Text t0
|
|
Attributes
|
|
ID : 1
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID : disabled
|
|
Associated Keyboard: none
|
|
Text :
|
|
Max. Text Size : 10
|
|
|
|
Text pin
|
|
Attributes
|
|
ID : 2
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID : disabled
|
|
Associated Keyboard: none
|
|
Text :
|
|
Max. Text Size : 25
|
|
|
|
Text title
|
|
Attributes
|
|
ID : 18
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID : disabled
|
|
Associated Keyboard: none
|
|
Text : Alarm
|
|
Max. Text Size : 10
|
|
|
|
Button b1
|
|
Attributes
|
|
ID : 3
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text : 1
|
|
Max. Text Size : 1
|
|
|
|
Events
|
|
Touch Release Event
|
|
pin.txt+=b1.txt
|
|
printh 91
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints rand,0
|
|
printh FF FF FF
|
|
|
|
Button bclose
|
|
Attributes
|
|
ID : 4
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text :
|
|
Max. Text Size : 10
|
|
|
|
Events
|
|
Touch Release Event
|
|
page page_id.val
|
|
|
|
Button b2
|
|
Attributes
|
|
ID : 5
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text : 2
|
|
Max. Text Size : 1
|
|
|
|
Events
|
|
Touch Release Event
|
|
pin.txt+=b2.txt
|
|
printh 91
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints rand,0
|
|
printh FF FF FF
|
|
|
|
Button b3
|
|
Attributes
|
|
ID : 6
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text : 3
|
|
Max. Text Size : 1
|
|
|
|
Events
|
|
Touch Release Event
|
|
pin.txt+=b3.txt
|
|
printh 91
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints rand,0
|
|
printh FF FF FF
|
|
|
|
Button b4
|
|
Attributes
|
|
ID : 7
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text : 4
|
|
Max. Text Size : 1
|
|
|
|
Events
|
|
Touch Release Event
|
|
pin.txt+=b4.txt
|
|
printh 91
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints rand,0
|
|
printh FF FF FF
|
|
|
|
Button b5
|
|
Attributes
|
|
ID : 8
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text : 5
|
|
Max. Text Size : 1
|
|
|
|
Events
|
|
Touch Release Event
|
|
pin.txt+=b5.txt
|
|
printh 91
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints rand,0
|
|
printh FF FF FF
|
|
|
|
Button b6
|
|
Attributes
|
|
ID : 9
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text : 6
|
|
Max. Text Size : 1
|
|
|
|
Events
|
|
Touch Release Event
|
|
pin.txt+=b6.txt
|
|
printh 91
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints rand,0
|
|
printh FF FF FF
|
|
|
|
Button b7
|
|
Attributes
|
|
ID : 10
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text : 7
|
|
Max. Text Size : 1
|
|
|
|
Events
|
|
Touch Release Event
|
|
pin.txt+=b7.txt
|
|
printh 91
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints rand,0
|
|
printh FF FF FF
|
|
|
|
Button b8
|
|
Attributes
|
|
ID : 11
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text : 8
|
|
Max. Text Size : 1
|
|
|
|
Events
|
|
Touch Release Event
|
|
pin.txt+=b8.txt
|
|
printh 91
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints rand,0
|
|
printh FF FF FF
|
|
|
|
Button b9
|
|
Attributes
|
|
ID : 12
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text : 9
|
|
Max. Text Size : 1
|
|
|
|
Events
|
|
Touch Release Event
|
|
pin.txt+=b9.txt
|
|
printh 91
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints rand,0
|
|
printh FF FF FF
|
|
|
|
Button bclear
|
|
Attributes
|
|
ID : 13
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text : <
|
|
Max. Text Size : 5
|
|
|
|
Events
|
|
Touch Release Event
|
|
pin.txt=""
|
|
printh 91
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints rand,0
|
|
printh FF FF FF
|
|
|
|
Button b0
|
|
Attributes
|
|
ID : 14
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text : 0
|
|
Max. Text Size : 1
|
|
|
|
Events
|
|
Touch Release Event
|
|
pin.txt+=b0.txt
|
|
printh 91
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints rand,0
|
|
printh FF FF FF
|
|
|
|
Button benter
|
|
Attributes
|
|
ID : 15
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text : OK
|
|
Max. Text Size : 3
|
|
|
|
Events
|
|
Touch Release Event
|
|
aux.txt="{\"page\": \"keyb_num\", \"key\": \""+key.txt+"\", \"value\": \""+value.txt+"\", \"entity\": \""+entity.txt+"\", \"pin\": \""+pin.txt+"\", \"base_domain\": \""+domain.txt+"\"}"
|
|
printh 92
|
|
prints "localevent",0
|
|
printh 00
|
|
prints aux.txt,0
|
|
printh 00
|
|
printh FF FF FF
|
|
|
|
Button bview
|
|
Attributes
|
|
ID : 16
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
State : unpressed
|
|
Text : O
|
|
Max. Text Size : 3
|
|
|
|
Events
|
|
Touch Press Event
|
|
if(pin.pw==1)
|
|
{
|
|
pin.pw=0
|
|
}else
|
|
{
|
|
pin.pw=1
|
|
}
|
|
|
|
Timer wakeup_timer
|
|
Attributes
|
|
ID : 24
|
|
Scope : local
|
|
Period (ms): 100
|
|
Enabled : yes
|
|
|
|
Events
|
|
Timer Event
|
|
if(dim<brightness)
|
|
{
|
|
dimdelta=brightness-dim
|
|
dimdelta/=10
|
|
if(dimdelta<1)
|
|
{
|
|
dimdelta=1
|
|
}
|
|
dim+=dimdelta
|
|
}else
|
|
{
|
|
wakeup_timer.en=0
|
|
}
|
|
|