From d284c6369e0cc77a5f99a6d09b3834be9e63e1f3 Mon Sep 17 00:00:00 2001 From: Charles Garwood Date: Wed, 20 Jan 2021 08:34:14 -0500 Subject: [PATCH] Add permanent_hold attribute to Honeywell climate (#45341) --- homeassistant/components/honeywell/climate.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/homeassistant/components/honeywell/climate.py b/homeassistant/components/honeywell/climate.py index 0e7958a3ea1..4b87350aec8 100644 --- a/homeassistant/components/honeywell/climate.py +++ b/homeassistant/components/honeywell/climate.py @@ -53,6 +53,8 @@ CONF_LOC_ID = "location" DEFAULT_COOL_AWAY_TEMPERATURE = 88 DEFAULT_HEAT_AWAY_TEMPERATURE = 61 +ATTR_PERMANENT_HOLD = "permanent_hold" + PLATFORM_SCHEMA = vol.All( cv.deprecated(CONF_REGION), PLATFORM_SCHEMA.extend( @@ -199,6 +201,7 @@ class HoneywellUSThermostat(ClimateEntity): """Return the device specific state attributes.""" data = {} data[ATTR_FAN_ACTION] = "running" if self._device.fan_running else "idle" + data[ATTR_PERMANENT_HOLD] = self._is_permanent_hold() if self._device.raw_dr_data: data["dr_phase"] = self._device.raw_dr_data.get("Phase") return data @@ -306,6 +309,11 @@ class HoneywellUSThermostat(ClimateEntity): """Return the list of available fan modes.""" return list(self._fan_mode_map) + def _is_permanent_hold(self) -> bool: + heat_status = self._device.raw_ui_data.get("StatusHeat", 0) + cool_status = self._device.raw_ui_data.get("StatusCool", 0) + return heat_status == 2 or cool_status == 2 + def _set_temperature(self, **kwargs) -> None: """Set new target temperature.""" temperature = kwargs.get(ATTR_TEMPERATURE)