From 0dfa5f9ffd335525b410eefe6807d52ae7f03112 Mon Sep 17 00:00:00 2001 From: Fredrik Erlandsson Date: Mon, 6 May 2019 13:43:35 +0200 Subject: [PATCH] Use local constant in Daikin for STATE_OFF (#23712) --- homeassistant/components/daikin/climate.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/daikin/climate.py b/homeassistant/components/daikin/climate.py index 0716a286b7c..7ea4e117743 100644 --- a/homeassistant/components/daikin/climate.py +++ b/homeassistant/components/daikin/climate.py @@ -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."""