There is some incomplete work related to alarms on this commit, but the focus here is to fix `restore_state` on ESPHome v2023.7.0. This solves #939
202 lines
5.3 KiB
Plaintext
202 lines
5.3 KiB
Plaintext
Page notification
|
|
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
|
|
dim=home.brightness.val
|
|
if(api==0)
|
|
{
|
|
page home
|
|
}else
|
|
{
|
|
printh 92
|
|
prints "nspanelevent",0
|
|
printh 00
|
|
prints "{\"page\": \"notification\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
|
printh 00
|
|
printh FF FF FF
|
|
}
|
|
|
|
Touch Press Event
|
|
printh 92
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints "{\"page\": \"notification\", \"component\": \"touchevent\", \"value\": \"press\"}",0
|
|
printh 00
|
|
printh FF FF FF
|
|
|
|
Touch Release Event
|
|
printh 92
|
|
prints "touchevent",0
|
|
printh 00
|
|
prints "{\"page\": \"notification\", \"component\": \"touchevent\", \"value\": \"release\"}",0
|
|
printh 00
|
|
printh FF FF FF
|
|
|
|
Variable (string) lastclick
|
|
Attributes
|
|
ID : 10
|
|
Scope : local
|
|
Text :
|
|
Max. Text Size: 100
|
|
|
|
Text notifi_text01
|
|
Attributes
|
|
ID : 2
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID : disabled
|
|
Associated Keyboard: none
|
|
Text :
|
|
Max. Text Size : 100
|
|
|
|
Text notifi_label
|
|
Attributes
|
|
ID : 3
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID : disabled
|
|
Associated Keyboard: none
|
|
Text :
|
|
Max. Text Size : 30
|
|
|
|
Picture accept_pic
|
|
Attributes
|
|
ID : 4
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
|
|
Picture clear_pic
|
|
Attributes
|
|
ID : 5
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
|
|
Hotspot notifi_back
|
|
Attributes
|
|
ID : 1
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
|
|
Events
|
|
Touch Press Event
|
|
page home
|
|
|
|
Hotspot accept
|
|
Attributes
|
|
ID : 6
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
|
|
Hotspot clear
|
|
Attributes
|
|
ID : 7
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
|
|
Hotspot accept_hotspot
|
|
Attributes
|
|
ID : 11
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
|
|
Events
|
|
Touch Release Event
|
|
lastclick.txt="{\"page\": \"notification\", \"component\": \"accept\", \"value\": \"release\"}"
|
|
printh 92
|
|
prints "nspanelevent",0
|
|
printh 00
|
|
prints lastclick.txt,0
|
|
printh 00
|
|
printh FF FF FF
|
|
|
|
Hotspot clear_hotspot
|
|
Attributes
|
|
ID : 12
|
|
Scope : local
|
|
Dragging : 0
|
|
Send Component ID: disabled
|
|
|
|
Events
|
|
Touch Release Event
|
|
lastclick.txt="{\"page\": \"notification\", \"component\": \"clear\", \"value\": \"release\"}"
|
|
printh 92
|
|
prints "nspanelevent",0
|
|
printh 00
|
|
prints lastclick.txt,0
|
|
printh 00
|
|
printh FF FF FF
|
|
|
|
Timer swipestore
|
|
Attributes
|
|
ID : 9
|
|
Scope : local
|
|
Period (ms): 50
|
|
Enabled : no
|
|
|
|
Events
|
|
Timer Event
|
|
swipex=tch0
|
|
swipey=tch1
|
|
|
|
TouchCap swipe
|
|
Attributes
|
|
ID : 8
|
|
Scope: local
|
|
Value: 0
|
|
|
|
Events
|
|
Touch Press Event
|
|
swipestore.en=1 // Start swipestore timer
|
|
|
|
Touch Release Event
|
|
swipestore.en=0
|
|
// Touch has ended, x
|
|
if(tch0==0)
|
|
{
|
|
swipec=swipex-tch2
|
|
// From Left to Right
|
|
if(swipec>swipedx)
|
|
{
|
|
//page
|
|
}
|
|
// Right to Left
|
|
swipec2=0-swipedx
|
|
if(swipec<swipec2)
|
|
{
|
|
//page
|
|
}
|
|
}
|
|
// Touch has ended, y
|
|
if(tch1==0)
|
|
{
|
|
swipec=swipey-tch3
|
|
// From Up to Down
|
|
if(swipec>100)
|
|
{
|
|
//page
|
|
}
|
|
// Down to Up
|
|
swipec2=0-swipedy
|
|
if(swipec<-100)
|
|
{
|
|
//page
|
|
}
|
|
}
|
|
|