Climate page - Performance & bug fix (#854)

* Climate page - Performance & bug fix

Performance improvement:
- Moved icon definition to TFT, so only buttons related to supported hvac modes will be updated and just icon color and link enabling is sent.
Bug fixing:
- Removed incorrect button name on buttons update
Others:
- Merged `set_climate_target_temp` into `set_climate` services
- Update current temperature when target temperature is updated

* Removed reference to `set_climate_target_temp`

Removed unused entry from blueprint.

* Removed service `set_climate_target_temp`

* Update `nspanel_eu`

- Set climate buttons on the TFT.
- Bump version to 3.3.2 (temporarily, to align with ESPHome and Blueprint)

* Update `nspanel_eu_code`
This commit is contained in:
Edward Firmo
2023-06-02 09:02:41 +02:00
committed by GitHub
parent 3b4cc94518
commit ab067bd20c
5 changed files with 48 additions and 689 deletions

View File

@@ -1,583 +0,0 @@
Page climate
Attributes
ID : 0
Scope : local
Dragging : 0
Send Component ID : disabled
Locked : no
Swide up page ID : disabled
Swide down page ID : disabled
Swide left page ID : disabled
Swide right page ID: disabled
Events
Preinitialize Event
printh 92
prints "nspanelevent",0
printh 00
prints "{\"page\": \"climate\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
printh 00
printh FF FF FF
vis target_icon,0
vis target_temp,0
vis current_temp,0
vis current_icon,0
vis climateslider,0
Touch Press Event
printh 92
prints "touchevent",0
printh 00
prints "{\"page\": \"climate\", \"component\": \"touchevent\", \"value\": \"press\"}",0
printh 00
printh FF FF FF
Touch Release Event
printh 92
prints "touchevent",0
printh 00
prints "{\"page\": \"climate\", \"component\": \"touchevent\", \"value\": \"release\"}",0
printh 00
printh FF FF FF
Page Exit Event
if(timer01.en==1)
{
timer01.en=0
covx target_temp.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
Scope : local
Text :
Max. Text Size: 10
Variable (string) climatesetting
Attributes
ID : 28
Scope : local
Text :
Max. Text Size: 100
Variable (string) lastclick
Attributes
ID : 37
Scope : local
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
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Value : 0
Text current_temp
Attributes
ID : 3
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 6
Text climate_label
Attributes
ID : 8
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 30
Text current_icon
Attributes
ID : 10
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text target_icon
Attributes
ID : 11
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text value01_icon
Attributes
ID : 12
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text value01
Attributes
ID : 13
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text value02_icon
Attributes
ID : 14
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text value02
Attributes
ID : 15
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text value03_icon
Attributes
ID : 16
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text value03
Attributes
ID : 17
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text value04_icon
Attributes
ID : 18
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text value04
Attributes
ID : 19
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text button01_icon
Attributes
ID : 20
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text button02_icon
Attributes
ID : 21
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text button03_icon
Attributes
ID : 22
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text button04_icon
Attributes
ID : 23
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text button05_icon
Attributes
ID : 24
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text button06_icon
Attributes
ID : 25
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text button07_icon
Attributes
ID : 26
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text t0
Attributes
ID : 29
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : °
Max. Text Size : 6
Picture climate_exit
Attributes
ID : 6
Scope : local
Dragging : 0
Send Component ID: disabled
Slider climateslider
Attributes
ID : 9
Scope : local
Dragging : 0
Send Component ID: disabled
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
Attributes
ID : 4
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Press Event
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
Hotspot increase_temp
Attributes
ID : 5
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Press Event
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
Hotspot climate_back
Attributes
ID : 7
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Press Event
climatesetting.txt="{\"page\": \"climate\", \"component\": \"close\", \"value\": \"press\"}"
printh 92
prints "nspanelevent",0
printh 00
prints climatesetting.txt,0
printh 00
printh FF FF FF
Touch Release Event
climatesetting.txt="{\"page\": \"climate\", \"component\": \"close\", \"value\": \"release\"}"
printh 92
prints "nspanelevent",0
printh 00
prints climatesetting.txt,0
printh 00
printh FF FF FF
Hotspot button01
Attributes
ID : 30
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Release Event
lastclick.txt="{\"page\": \"climate\", \"component\": \"button01\", \"value\": \"release\"}"
printh 92
prints "nspanelevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Hotspot button02
Attributes
ID : 31
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Release Event
lastclick.txt="{\"page\": \"climate\", \"component\": \"button02\", \"value\": \"release\"}"
printh 92
prints "nspanelevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Hotspot button03
Attributes
ID : 32
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Release Event
lastclick.txt="{\"page\": \"climate\", \"component\": \"button03\", \"value\": \"release\"}"
printh 92
prints "nspanelevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Hotspot button04
Attributes
ID : 33
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Release Event
lastclick.txt="{\"page\": \"climate\", \"component\": \"button04\", \"value\": \"release\"}"
printh 92
prints "nspanelevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Hotspot button05
Attributes
ID : 34
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Release Event
lastclick.txt="{\"page\": \"climate\", \"component\": \"button05\", \"value\": \"release\"}"
printh 92
prints "nspanelevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Hotspot button06
Attributes
ID : 35
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Release Event
lastclick.txt="{\"page\": \"climate\", \"component\": \"button06\", \"value\": \"release\"}"
printh 92
prints "nspanelevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Hotspot button07
Attributes
ID : 36
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Release Event
lastclick.txt="{\"page\": \"climate\", \"component\": \"button07\", \"value\": \"release\"}"
printh 92
prints "nspanelevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Timer swipestore
Attributes
ID : 2
Scope : local
Period (ms): 50
Enabled : no
Events
Timer Event
swipex=tch0
swipey=tch1
Timer timer01
Attributes
ID : 39
Scope : local
Period (ms): 2000
Enabled : yes
Events
Timer Event
timer01.en=0
covx target_temp.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
Scope: local
Value: 0
Events
Touch Press Event
swipestore.en=1 // Start swipestore timer
Touch Release Event
swipestore.en=0
// Touch has ended, x
if(tch0==0)
{
swipec=swipex-tch2
// From Left to Right
if(swipec>swipedx)
{
//page
}
// Right to Left
swipec2=0-swipedx
if(swipec<swipec2)
{
//page
}
}
// Touch has ended, y
if(tch1==0)
{
swipec=swipey-tch3
// From Up to Down
if(swipec>100)
{
//page
}
// Down to Up
swipec2=0-swipedy
if(swipec<-100)
{
//page
}
}