mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Add HVACAction to incomfort climate devices (#119315)
* Add HVACAction to incomfort climate devices * Use IDLE state when not heating
This commit is contained in:
parent
d74d418c06
commit
d6bcb1c5fd
@ -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."""
|
||||
|
@ -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'>,
|
||||
]),
|
||||
|
Loading…
x
Reference in New Issue
Block a user