mariusz-ostoja-swierczynski / tech-controllers

TECH Controllers integration for Home Assistant
MIT License
95 stars 67 forks source link

change to fix eventual consistency #87

Closed daroga0002 closed 6 months ago

daroga0002 commented 7 months ago

Closes #70

This is extending logic during set temperature function. So I am doing two things:

Tests on my environment showed it is working as planned.

Logs from this:

2024-04-23 20:09:25.475 DEBUG (MainThread) [custom_components.tech.tech] Updating zones cache for controller: 47a0aaaaaaacbbbbbbbbbbbbbbbbbbb
2024-04-23 20:09:25.476 DEBUG (MainThread) [custom_components.tech.tech] Updating tiles cache for controller: 47a0aaaaaaacbbbbbbbbbbbbbbbbbbb
2024-04-23 20:09:25.476 DEBUG (MainThread) [custom_components.tech] Finished fetching tech data in 0.174 seconds (success: True)
2024-04-23 20:09:43.453 DEBUG (MainThread) [custom_components.tech.climate] Salon: Setting temperature to 20.299999999999997
2024-04-23 20:09:43.453 DEBUG (MainThread) [custom_components.tech.tech] Setting zone constant temperature...
2024-04-23 20:09:43.453 DEBUG (MainThread) [custom_components.tech.tech] {'mode': {'id': 9072, 'parentId': 9070, 'mode': 'constantTemp', 'constTempTime': 60, 'setTemperature': 202, 'scheduleIndex': 0}}
2024-04-23 20:09:43.453 DEBUG (MainThread) [custom_components.tech.tech] Sending POST request: https://emodul.eu/api/v1/users/111111111/modules/47a0aaaaaaacbbbbbbbbbbbbbbbbbbb/zones
2024-04-23 20:09:43.714 DEBUG (MainThread) [custom_components.tech.tech] {'message': 'Data has been sent correctly'}
2024-04-23 20:09:43.715 DEBUG (MainThread) [custom_components.tech] Updating data for: Ogrzewanie
2024-04-23 20:09:43.716 DEBUG (MainThread) [custom_components.tech.tech] Updating module zones & tiles cache... 47a0aaaaaaacbbbbbbbbbbbbbbbbbbb
2024-04-23 20:09:43.716 DEBUG (MainThread) [custom_components.tech.tech] Getting module data...  47a0aaaaaaacbbbbbbbbbbbbbbbbbbb,  111111111
2024-04-23 20:09:43.716 DEBUG (MainThread) [custom_components.tech.tech] Sending GET request: https://emodul.eu/api/v1/users/111111111/modules/47a0aaaaaaacbbbbbbbbbbbbbbbbbbb
2024-04-23 20:09:43.932 DEBUG (MainThread) [custom_components.tech.tech] Updating zones cache for controller: 47a0aaaaaaacbbbbbbbbbbbbbbbbbbb
2024-04-23 20:09:43.932 DEBUG (MainThread) [custom_components.tech.tech] Updating tiles cache for controller: 47a0aaaaaaacbbbbbbbbbbbbbbbbbbb
2024-04-23 20:09:43.932 DEBUG (MainThread) [custom_components.tech] Finished fetching tech data in 0.217 seconds (success: True)
2024-04-23 20:09:43.933 DEBUG (MainThread) [custom_components.tech.climate] Zone ID 9070 is duringChange so ignore to update target temperature