Climate: support to target_temp_step (#853)

* Climate: support to `target_temp_step`

Adding support to attribute `target_temp_step` to define the step of changing temperature.
`0.5` will be used if this attribute is not available on the climate entity.

* Update nspanel_esphome.yaml

* Update nspanel_eu files

* Update nspanel_eu_code files
This commit is contained in:
Edward Firmo
2023-06-01 18:30:16 +02:00
committed by GitHub
parent 0e48d65549
commit 94d3157c4d
5 changed files with 133 additions and 80 deletions

View File

@@ -44,7 +44,7 @@ Page climate
if(timer01.en==1)
{
timer01.en=0
covx climateslider.val,va1.txt,0,0
covx target_temp.val,va1.txt,0,0
climatesetting.txt="{\"page\": \"climate\", \"component\": \"climate_position\", \"value\": "+va1.txt+"}"
printh 92
prints "nspanelevent",0
@@ -75,6 +75,18 @@ Variable (string) lastclick
Text :
Max. Text Size: 100
Variable (int32) temp_offset
Attributes
ID : 40
Scope: local
Value: 0
Variable (int32) temp_step
Attributes
ID : 41
Scope: local
Value: 1
XFloat target_temp
Attributes
ID : 38
@@ -297,13 +309,15 @@ Slider climateslider
Scope : local
Dragging : 0
Send Component ID: disabled
Position : 180
Upper range limit: 250
Lower range limit: 50
Position : 20
Upper range limit: 40
Lower range limit: 0
Events
Touch Release Event
target_temp.val=climateslider.val
target_temp.val*=temp_step.val
target_temp.val+=temp_offset.val
timer01.en=1
Hotspot decrease_temp
@@ -315,8 +329,13 @@ Hotspot decrease_temp
Events
Touch Press Event
climateslider.val-=1
target_temp.val=climateslider.val
if(climateslider.val>0)
{
climateslider.val-=1
target_temp.val=climateslider.val
target_temp.val*=temp_step.val
target_temp.val+=temp_offset.val
}
Touch Release Event
timer01.en=1
@@ -330,8 +349,13 @@ Hotspot increase_temp
Events
Touch Press Event
climateslider.val+=1
target_temp.val=climateslider.val
if(climateslider.val<climateslider.maxval)
{
climateslider.val+=1
target_temp.val=climateslider.val
target_temp.val*=temp_step.val
target_temp.val+=temp_offset.val
}
Touch Release Event
timer01.en=1
@@ -503,7 +527,7 @@ Timer timer01
Events
Timer Event
timer01.en=0
covx climateslider.val,va1.txt,0,0
covx target_temp.val,va1.txt,0,0
climatesetting.txt="{\"page\": \"climate\", \"component\": \"climate_position\", \"value\": "+va1.txt+"}"
printh 92
prints "nspanelevent",0