1
mirror of https://github.com/home-assistant/core synced 2024-07-21 14:24:50 +02:00

Use local constant in Daikin for STATE_OFF (#23712)

This commit is contained in:
Fredrik Erlandsson 2019-05-06 13:43:35 +02:00 committed by Martin Hjelmare
parent b331b081f0
commit 0dfa5f9ffd

View File

@ -274,7 +274,8 @@ class DaikinClimate(ClimateDevice):
def is_on(self):
"""Return true if on."""
return self._api.device.represent(
HA_ATTR_TO_DAIKIN[ATTR_OPERATION_MODE])[1] != STATE_OFF
HA_ATTR_TO_DAIKIN[ATTR_OPERATION_MODE]
)[1] != HA_STATE_TO_DAIKIN[STATE_OFF]
async def async_turn_on(self):
"""Turn device on."""
@ -282,14 +283,17 @@ class DaikinClimate(ClimateDevice):
async def async_turn_off(self):
"""Turn device off."""
await self._api.device.set(
{HA_ATTR_TO_DAIKIN[ATTR_OPERATION_MODE]: STATE_OFF})
await self._api.device.set({
HA_ATTR_TO_DAIKIN[ATTR_OPERATION_MODE]:
HA_STATE_TO_DAIKIN[STATE_OFF]
})
@property
def is_away_mode_on(self):
"""Return true if away mode is on."""
return self._api.device.represent(
HA_ATTR_TO_DAIKIN[ATTR_AWAY_MODE])[1] != STATE_OFF
HA_ATTR_TO_DAIKIN[ATTR_AWAY_MODE]
)[1] != HA_STATE_TO_DAIKIN[STATE_OFF]
async def async_turn_away_mode_on(self):
"""Turn away mode on."""