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:
BIN
nspanel_eu.HMI
BIN
nspanel_eu.HMI
Binary file not shown.
BIN
nspanel_eu.tft
BIN
nspanel_eu.tft
Binary file not shown.
@@ -40,6 +40,20 @@ Page climate
|
|||||||
printh 00
|
printh 00
|
||||||
printh FF FF FF
|
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
|
Variable (string) va1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 27
|
ID : 27
|
||||||
@@ -289,15 +303,8 @@ Slider climateslider
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
covx climateslider.val,va1.txt,0,0
|
|
||||||
target_temp.val=climateslider.val
|
target_temp.val=climateslider.val
|
||||||
climatesetting.txt="{\"page\": \"climate\", \"component\": \"climate_position\", \"value\": "+va1.txt+"}"
|
timer01.en=1
|
||||||
printh 92
|
|
||||||
prints "nspanelevent",0
|
|
||||||
printh 00
|
|
||||||
prints climatesetting.txt,0
|
|
||||||
printh 00
|
|
||||||
printh FF FF FF
|
|
||||||
|
|
||||||
Hotspot decrease_temp
|
Hotspot decrease_temp
|
||||||
Attributes
|
Attributes
|
||||||
@@ -308,25 +315,11 @@ Hotspot decrease_temp
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
climatesetting.txt="{\"page\": \"climate\", \"component\": \"decreasetemp\", \"value\": \"press\"}"
|
climateslider.val-=1
|
||||||
printh 92
|
target_temp.val=climateslider.val
|
||||||
prints "nspanelevent",0
|
|
||||||
printh 00
|
|
||||||
prints climatesetting.txt,0
|
|
||||||
printh 00
|
|
||||||
printh FF FF FF
|
|
||||||
|
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
climateslider.val-=1
|
timer01.en=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
|
|
||||||
|
|
||||||
Hotspot increase_temp
|
Hotspot increase_temp
|
||||||
Attributes
|
Attributes
|
||||||
@@ -337,25 +330,11 @@ Hotspot increase_temp
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
climatesetting.txt="{\"page\": \"climate\", \"component\": \"increasetemp\", \"value\": \"press\"}"
|
climateslider.val+=1
|
||||||
printh 92
|
target_temp.val=climateslider.val
|
||||||
prints "nspanelevent",0
|
|
||||||
printh 00
|
|
||||||
prints climatesetting.txt,0
|
|
||||||
printh 00
|
|
||||||
printh FF FF FF
|
|
||||||
|
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
climateslider.val+=1
|
timer01.en=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
|
|
||||||
|
|
||||||
Hotspot climate_back
|
Hotspot climate_back
|
||||||
Attributes
|
Attributes
|
||||||
@@ -514,6 +493,25 @@ Timer swipestore
|
|||||||
swipex=tch0
|
swipex=tch0
|
||||||
swipey=tch1
|
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
|
TouchCap swipe
|
||||||
Attributes
|
Attributes
|
||||||
ID : 1
|
ID : 1
|
||||||
|
|||||||
Reference in New Issue
Block a user