ESPHome Watchdog

This implements a watchdog script with complementing the scripts `on_setup` and `refresh_wifi_icon` to be checking the components every minute and taking proper actions (when possible).
Solves #1464
This commit is contained in:
Edward Firmo
2023-12-27 13:57:16 +01:00
parent 29fface258
commit 4ad5457b0f
13 changed files with 302 additions and 370 deletions

View File

@@ -13,19 +13,7 @@ Page blank
Events
Preinitialize Event
sendme
printh 92
prints "currentpage",0
printh 00
prints "blank",0
printh 00
printh FF FF FF
dim=100
printh 92
prints "nspanelevent",0
printh 00
prints "{\"page\": \"blank\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"version\": \"2023.11.1\"}",0
printh 00
printh FF FF FF
covx baud,baud_rate.txt,0,0
baud_rate.txt+=" bps"
@@ -37,12 +25,18 @@ Page blank
dim=100
tm0.en=1
Variable (string) nspanelevent
Variable (int32) counter
Attributes
ID : 9
Scope: local
Value: 0
Variable (string) aux1
Attributes
ID : 10
Scope : local
Text :
Max. Text Size: 150
Max. Text Size: 10
Text file_name
Attributes
@@ -89,7 +83,7 @@ Text tft_version
Dragging : 0
Send Component ID : on press and release
Associated Keyboard: none
Text : TFT: v2023.12.1
Text : TFT: v2023.12.2
Max. Text Size : 20
Events
@@ -190,30 +184,30 @@ Timer tm_esphome
Events
Timer Event
if(baud==115200)
counter.val++
if(counter.val>60)
{
bauds=921600
}else
rest
}
sendme
printh 91
prints "display_mode",0
printh 00
prints display_mode,0
printh FF FF FF
printh 92
prints "tft_version",0
printh 00
prints tft_version.txt,0
printh 00
printh FF FF FF
covx counter.val,aux1.txt,0,0
esp_version.txt="ESP: Retry #"+aux1.txt
sys0=counter.val%10
if(sys0==0)
{
bauds=115200
baud=115200
}
covx baud,baud_rate.txt,0,0
baud_rate.txt+=" bps"
Timer tm_pageid
Attributes
ID : 9
Scope : local
Period (ms): 2500
Enabled : yes
Events
Timer Event
nspanelevent.txt="{\"page\": \"blank\", \"event\": \"pagechanged\", \"version\": \""+tft_version.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints nspanelevent.txt,0
printh 00
printh FF FF FF