mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +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 (
|
from homeassistant.components.climate import (
|
||||||
ClimateEntity,
|
ClimateEntity,
|
||||||
ClimateEntityFeature,
|
ClimateEntityFeature,
|
||||||
|
HVACAction,
|
||||||
HVACMode,
|
HVACMode,
|
||||||
)
|
)
|
||||||
from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature
|
from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature
|
||||||
@ -56,6 +57,7 @@ class InComfortClimate(IncomfortEntity, ClimateEntity):
|
|||||||
"""Initialize the climate device."""
|
"""Initialize the climate device."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
|
|
||||||
|
self._heater = heater
|
||||||
self._room = room
|
self._room = room
|
||||||
|
|
||||||
self._attr_unique_id = f"{heater.serial_no}_{room.room_no}"
|
self._attr_unique_id = f"{heater.serial_no}_{room.room_no}"
|
||||||
@ -75,6 +77,13 @@ class InComfortClimate(IncomfortEntity, ClimateEntity):
|
|||||||
"""Return the current temperature."""
|
"""Return the current temperature."""
|
||||||
return self._room.room_temp
|
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
|
@property
|
||||||
def target_temperature(self) -> float | None:
|
def target_temperature(self) -> float | None:
|
||||||
"""Return the temperature we try to reach."""
|
"""Return the temperature we try to reach."""
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
'attributes': ReadOnlyDict({
|
'attributes': ReadOnlyDict({
|
||||||
'current_temperature': 21.4,
|
'current_temperature': 21.4,
|
||||||
'friendly_name': 'Thermostat 1',
|
'friendly_name': 'Thermostat 1',
|
||||||
|
'hvac_action': <HVACAction.IDLE: 'idle'>,
|
||||||
'hvac_modes': list([
|
'hvac_modes': list([
|
||||||
<HVACMode.HEAT: 'heat'>,
|
<HVACMode.HEAT: 'heat'>,
|
||||||
]),
|
]),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user