Remove entity info from pages on TFT

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
This commit is contained in:
Edward Firmo
2023-09-13 23:36:24 +02:00
parent a836462df1
commit d1638863a4
31 changed files with 315 additions and 482 deletions

View File

@@ -17,11 +17,10 @@ Page alarm
page home
}else
{
lastclick.txt="{\"page\": \"alarm\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+entity.txt+"\"}"
printh 92
prints "nspanelevent",0
printh 00
prints lastclick.txt,0
prints "{\"page\": \"alarm\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
printh 00
printh FF FF FF
vis bt_home,0
@@ -66,16 +65,9 @@ Variable (string) code_format
Text :
Max. Text Size: 15
Variable (string) entity
Attributes
ID : 30
Scope : global
Text :
Max. Text Size: 100
Variable (string) code_arm_req
Attributes
ID : 31
ID : 30
Scope : local
Text :
Max. Text Size: 1
@@ -264,7 +256,7 @@ Picture bt_disarm_pic
Button button_back
Attributes
ID : 32
ID : 31
Scope : local
Dragging : 0
Send Component ID: disabled
@@ -307,7 +299,7 @@ Hotspot bt_home
bt_home_icon.pco=0
Touch Release Event
lastclick.txt="{\"page\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_home_text.txt+"\", \"code_format\": \""+code_format.txt+"\", \"code_arm_req\": \""+code_arm_req.txt+"\"}"
lastclick.txt="{\"page\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"mui\": \""+bt_home_text.txt+"\", \"code_format\": \""+code_format.txt+"\", \"code_arm_req\": \""+code_arm_req.txt+"\"}"
printh 92
prints "localevent",0
printh 00
@@ -331,7 +323,7 @@ Hotspot bt_away
bt_away_icon.pco=0
Touch Release Event
lastclick.txt="{\"page\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_away_text.txt+"\", \"code_format\": \""+code_format.txt+"\", \"code_arm_req\": \""+code_arm_req.txt+"\"}"
lastclick.txt="{\"page\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"mui\": \""+bt_away_text.txt+"\", \"code_format\": \""+code_format.txt+"\", \"code_arm_req\": \""+code_arm_req.txt+"\"}"
printh 92
prints "localevent",0
printh 00
@@ -355,7 +347,7 @@ Hotspot bt_night
bt_night_icon.pco=0
Touch Release Event
lastclick.txt="{\"page\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_night_text.txt+"\", \"code_format\": \""+code_format.txt+"\", \"code_arm_req\": \""+code_arm_req.txt+"\"}"
lastclick.txt="{\"page\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"mui\": \""+bt_night_text.txt+"\", \"code_format\": \""+code_format.txt+"\", \"code_arm_req\": \""+code_arm_req.txt+"\"}"
printh 92
prints "localevent",0
printh 00
@@ -379,7 +371,7 @@ Hotspot bt_vacat
bt_vacat_icon.pco=0
Touch Release Event
lastclick.txt="{\"page\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_vacat_text.txt+"\", \"code_format\": \""+code_format.txt+"\", \"code_arm_req\": \""+code_arm_req.txt+"\"}"
lastclick.txt="{\"page\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"mui\": \""+bt_vacat_text.txt+"\", \"code_format\": \""+code_format.txt+"\", \"code_arm_req\": \""+code_arm_req.txt+"\"}"
printh 92
prints "localevent",0
printh 00
@@ -403,7 +395,7 @@ Hotspot bt_bypass
bt_bypass_icon.pco=0
Touch Release Event
lastclick.txt="{\"page\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_bypass_text.txt+"\", \"code_format\": \""+code_format.txt+"\", \"code_arm_req\": \""+code_arm_req.txt+"\"}"
lastclick.txt="{\"page\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"mui\": \""+bt_bypass_text.txt+"\", \"code_format\": \""+code_format.txt+"\", \"code_arm_req\": \""+code_arm_req.txt+"\"}"
printh 92
prints "localevent",0
printh 00
@@ -427,7 +419,7 @@ Hotspot bt_disarm
bt_disarm_icon.pco=0
Touch Release Event
lastclick.txt="{\"page\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_disarm_text.txt+"\", \"code_format\": \""+code_format.txt+"\", \"code_arm_req\": \""+code_arm_req.txt+"\"}"
lastclick.txt="{\"page\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"mui\": \""+bt_disarm_text.txt+"\", \"code_format\": \""+code_format.txt+"\", \"code_arm_req\": \""+code_arm_req.txt+"\"}"
printh 92
prints "localevent",0
printh 00
@@ -437,7 +429,7 @@ Hotspot bt_disarm
Timer wakeup_timer
Attributes
ID : 33
ID : 32
Scope : local
Period (ms): 100
Enabled : yes