From d6bcb1c5fd30acea8c08dc6e2c88078eba8d947a Mon Sep 17 00:00:00 2001 From: Jan Bouwhuis Date: Mon, 10 Jun 2024 19:23:12 +0200 Subject: [PATCH] Add HVACAction to incomfort climate devices (#119315) * Add HVACAction to incomfort climate devices * Use IDLE state when not heating --- homeassistant/components/incomfort/climate.py | 9 +++++++++ tests/components/incomfort/snapshots/test_climate.ambr | 1 + 2 files changed, 10 insertions(+) diff --git a/homeassistant/components/incomfort/climate.py b/homeassistant/components/incomfort/climate.py index 7e5cbd08f18..c55c9410f87 100644 --- a/homeassistant/components/incomfort/climate.py +++ b/homeassistant/components/incomfort/climate.py @@ -9,6 +9,7 @@ from incomfortclient import Heater as InComfortHeater, Room as InComfortRoom from homeassistant.components.climate import ( ClimateEntity, ClimateEntityFeature, + HVACAction, HVACMode, ) from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature @@ -56,6 +57,7 @@ class InComfortClimate(IncomfortEntity, ClimateEntity): """Initialize the climate device.""" super().__init__(coordinator) + self._heater = heater self._room = room self._attr_unique_id = f"{heater.serial_no}_{room.room_no}" @@ -75,6 +77,13 @@ class InComfortClimate(IncomfortEntity, ClimateEntity): """Return the current temperature.""" return self._room.room_temp + @property + def hvac_action(self) -> HVACAction | None: + """Return the actual current HVAC action.""" + if self._heater.is_burning and self._heater.is_pumping: + return HVACAction.HEATING + return HVACAction.IDLE + @property def target_temperature(self) -> float | None: """Return the temperature we try to reach.""" diff --git a/tests/components/incomfort/snapshots/test_climate.ambr b/tests/components/incomfort/snapshots/test_climate.ambr index b9a86d26139..05b2d4878d0 100644 --- a/tests/components/incomfort/snapshots/test_climate.ambr +++ b/tests/components/incomfort/snapshots/test_climate.ambr @@ -43,6 +43,7 @@ 'attributes': ReadOnlyDict({ 'current_temperature': 21.4, 'friendly_name': 'Thermostat 1', + 'hvac_action': , 'hvac_modes': list([ , ]),