From 9902ecb4176a2bacc379dbcce4d1ce511e3b97c1 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk <11290930+bouwew@users.noreply.github.com> Date: Fri, 1 Apr 2022 20:53:09 +0200 Subject: [PATCH] Remove use of HVAC_MODE_OFF in plugwise climate, it's not implemented (#69094) --- homeassistant/components/plugwise/climate.py | 5 ++--- tests/components/plugwise/test_climate.py | 4 ---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/plugwise/climate.py b/homeassistant/components/plugwise/climate.py index 12a203b6896..1e4b972e4d0 100644 --- a/homeassistant/components/plugwise/climate.py +++ b/homeassistant/components/plugwise/climate.py @@ -12,7 +12,6 @@ from homeassistant.components.climate.const import ( HVAC_MODE_AUTO, HVAC_MODE_COOL, HVAC_MODE_HEAT, - HVAC_MODE_OFF, SUPPORT_PRESET_MODE, SUPPORT_TARGET_TEMPERATURE, ) @@ -64,7 +63,7 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity): self._attr_preset_modes = list(presets) # Determine hvac modes and current hvac mode - self._attr_hvac_modes = [HVAC_MODE_HEAT, HVAC_MODE_OFF] + self._attr_hvac_modes = [HVAC_MODE_HEAT] if self.coordinator.data.gateway.get("cooling_present"): self._attr_hvac_modes.append(HVAC_MODE_COOL) if self.device.get("available_schedules") != ["None"]: @@ -90,7 +89,7 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity): def hvac_mode(self) -> str: """Return HVAC operation ie. heat, cool mode.""" if (mode := self.device.get("mode")) is None or mode not in self.hvac_modes: - return HVAC_MODE_OFF + return HVAC_MODE_HEAT return mode @property diff --git a/tests/components/plugwise/test_climate.py b/tests/components/plugwise/test_climate.py index a52e4a955a6..a695906c0af 100644 --- a/tests/components/plugwise/test_climate.py +++ b/tests/components/plugwise/test_climate.py @@ -9,7 +9,6 @@ from homeassistant.components.climate.const import ( HVAC_MODE_AUTO, HVAC_MODE_COOL, HVAC_MODE_HEAT, - HVAC_MODE_OFF, ) from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError @@ -26,7 +25,6 @@ async def test_adam_climate_entity_attributes( assert state assert state.attributes["hvac_modes"] == [ HVAC_MODE_HEAT, - HVAC_MODE_OFF, HVAC_MODE_AUTO, ] @@ -47,7 +45,6 @@ async def test_adam_climate_entity_attributes( assert state.attributes["hvac_modes"] == [ HVAC_MODE_HEAT, - HVAC_MODE_OFF, HVAC_MODE_AUTO, ] @@ -161,7 +158,6 @@ async def test_anna_climate_entity_attributes( assert state.state == HVAC_MODE_HEAT assert state.attributes["hvac_modes"] == [ HVAC_MODE_HEAT, - HVAC_MODE_OFF, HVAC_MODE_COOL, ] assert "no_frost" in state.attributes["preset_modes"]