mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Handle case where 'mode' and 'fanSpeed' are missing JSON. Based on
changes in commit
adfb608f86
This commit is contained in:
parent
1831a7da68
commit
4b449f5f93
@ -273,7 +273,6 @@ class TadoClimate(ClimateDevice):
|
||||
else:
|
||||
self._device_is_active = True
|
||||
|
||||
if self._device_is_active:
|
||||
overlay = False
|
||||
overlay_data = None
|
||||
termination = self._current_operation
|
||||
@ -288,14 +287,22 @@ class TadoClimate(ClimateDevice):
|
||||
termination = overlay_data['termination']['type']
|
||||
|
||||
if 'setting' in overlay_data:
|
||||
cooling = overlay_data['setting']['mode'] == 'COOL'
|
||||
fan_speed = overlay_data['setting']['fanSpeed']
|
||||
setting_data = overlay_data['setting']
|
||||
setting = setting is not None
|
||||
|
||||
if setting:
|
||||
if 'mode' in setting_data:
|
||||
cooling = setting_data['mode'] == 'COOL'
|
||||
|
||||
if 'fanSpeed' in setting_data:
|
||||
fan_speed = setting_data['fanSpeed']
|
||||
|
||||
if self._device_is_active:
|
||||
# If you set mode manualy to off, there will be an overlay
|
||||
# and a termination, but we want to see the mode "OFF"
|
||||
|
||||
self._overlay_mode = termination
|
||||
self._current_operation = termination
|
||||
|
||||
self._cooling = cooling
|
||||
self._current_fan = fan_speed
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user