Add HVACAction to incomfort climate devices (#119315)

* Add HVACAction to incomfort climate devices

* Use IDLE state when not heating
This commit is contained in:
Jan Bouwhuis 2024-06-10 19:23:12 +02:00 committed by GitHub
parent d74d418c06
commit d6bcb1c5fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -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."""

View File

@ -43,6 +43,7 @@
'attributes': ReadOnlyDict({
'current_temperature': 21.4,
'friendly_name': 'Thermostat 1',
'hvac_action': <HVACAction.IDLE: 'idle'>,
'hvac_modes': list([
<HVACMode.HEAT: 'heat'>,
]),