2sec hold for sending target_temp (#851)

* 2sec hold for sending target_temp

Added 2sec hold of `target_temp` value before sending it to ESPHome and Blueprint, so the climate service is not called at every click on the slider or +/-.

* Update nspanel_eu_code
This commit is contained in:
Edward Firmo
2023-05-30 17:07:22 +02:00
committed by GitHub
parent 89e55a20d4
commit 0e48d65549
3 changed files with 40 additions and 42 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -40,6 +40,20 @@ Page climate
printh 00
printh FF FF FF
Page Exit Event
if(timer01.en==1)
{
timer01.en=0
covx climateslider.val,va1.txt,0,0
climatesetting.txt="{\"page\": \"climate\", \"component\": \"climate_position\", \"value\": "+va1.txt+"}"
printh 92
prints "nspanelevent",0
printh 00
prints climatesetting.txt,0
printh 00
printh FF FF FF
}
Variable (string) va1
Attributes
ID : 27
@@ -289,15 +303,8 @@ Slider climateslider
Events
Touch Release Event
covx climateslider.val,va1.txt,0,0
target_temp.val=climateslider.val
climatesetting.txt="{\"page\": \"climate\", \"component\": \"climate_position\", \"value\": "+va1.txt+"}"
printh 92
prints "nspanelevent",0
printh 00
prints climatesetting.txt,0
printh 00
printh FF FF FF
timer01.en=1
Hotspot decrease_temp
Attributes
@@ -308,25 +315,11 @@ Hotspot decrease_temp
Events
Touch Press Event
climatesetting.txt="{\"page\": \"climate\", \"component\": \"decreasetemp\", \"value\": \"press\"}"
printh 92
prints "nspanelevent",0
printh 00
prints climatesetting.txt,0
printh 00
printh FF FF FF
climateslider.val-=1
target_temp.val=climateslider.val
Touch Release Event
climateslider.val-=1
covx climateslider.val,va1.txt,0,0
target_temp.val=climateslider.val
climatesetting.txt="{\"page\": \"climate\", \"component\": \"climate_position\", \"value\": "+va1.txt+"}"
printh 92
prints "nspanelevent",0
printh 00
prints climatesetting.txt,0
printh 00
printh FF FF FF
timer01.en=1
Hotspot increase_temp
Attributes
@@ -337,25 +330,11 @@ Hotspot increase_temp
Events
Touch Press Event
climatesetting.txt="{\"page\": \"climate\", \"component\": \"increasetemp\", \"value\": \"press\"}"
printh 92
prints "nspanelevent",0
printh 00
prints climatesetting.txt,0
printh 00
printh FF FF FF
climateslider.val+=1
target_temp.val=climateslider.val
Touch Release Event
climateslider.val+=1
covx climateslider.val,va1.txt,0,0
target_temp.val=climateslider.val
climatesetting.txt="{\"page\": \"climate\", \"component\": \"climate_position\", \"value\": "+va1.txt+"}"
printh 92
prints "nspanelevent",0
printh 00
prints climatesetting.txt,0
printh 00
printh FF FF FF
timer01.en=1
Hotspot climate_back
Attributes
@@ -514,6 +493,25 @@ Timer swipestore
swipex=tch0
swipey=tch1
Timer timer01
Attributes
ID : 39
Scope : local
Period (ms): 2000
Enabled : yes
Events
Timer Event
timer01.en=0
covx climateslider.val,va1.txt,0,0
climatesetting.txt="{\"page\": \"climate\", \"component\": \"climate_position\", \"value\": "+va1.txt+"}"
printh 92
prints "nspanelevent",0
printh 00
prints climatesetting.txt,0
printh 00
printh FF FF FF
TouchCap swipe
Attributes
ID : 1