Set default values for Daikin devices that don't support fan direction and fan speed features (#12000)

This commit is contained in:
Frantz
2018-01-30 00:56:55 +02:00
committed by Paulus Schoutsen
parent 7ad870c4ff
commit 99c6a10b99

View File

@@ -98,10 +98,16 @@ class DaikinClimate(ClimateDevice):
daikin_attr = HA_ATTR_TO_DAIKIN[ATTR_FAN_MODE]
if self._api.device.values.get(daikin_attr) is not None:
self._supported_features |= SUPPORT_FAN_MODE
else:
# even devices without support must have a default valid value
self._api.device.values[daikin_attr] = 'A'
daikin_attr = HA_ATTR_TO_DAIKIN[ATTR_SWING_MODE]
if self._api.device.values.get(daikin_attr) is not None:
self._supported_features |= SUPPORT_SWING_MODE
else:
# even devices without support must have a default valid value
self._api.device.values[daikin_attr] = '0'
def get(self, key):
"""Retrieve device settings from API library cache."""