Add hvac_action to flexit_bacnet climate entity (#110498)

* Add hvac_action to flexit_bacnet climate entity

Also add extra state attributes

* Remove extra state attrs

* Change hvac action to heating
pull/111519/head
Jonas Fors Lellky 2024-02-26 20:22:25 +01:00 committed by GitHub
parent 730fe760cf
commit d44e389844
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 0 deletions

View File

@ -15,6 +15,7 @@ from homeassistant.components.climate import (
PRESET_HOME,
ClimateEntity,
ClimateEntityFeature,
HVACAction,
HVACMode,
)
from homeassistant.config_entries import ConfigEntry
@ -83,6 +84,13 @@ class FlexitClimateEntity(FlexitEntity, ClimateEntity):
"""Refresh unit state."""
await self.device.update()
@property
def hvac_action(self) -> HVACAction | None:
"""Return current HVAC action."""
if self.device.electric_heater:
return HVACAction.HEATING
return HVACAction.FAN
@property
def current_temperature(self) -> float:
"""Return the current temperature."""

View File

@ -60,6 +60,7 @@ def mock_flexit_bacnet() -> Generator[AsyncMock, None, None]:
flexit_bacnet.heat_exchanger_efficiency = 81
flexit_bacnet.heat_exchanger_speed = 100
flexit_bacnet.air_filter_polluted = False
flexit_bacnet.air_filter_exchange_interval = 8784
flexit_bacnet.electric_heater = True
# Mock fan setpoints

View File

@ -4,6 +4,7 @@
'attributes': ReadOnlyDict({
'current_temperature': 19.0,
'friendly_name': 'Device Name',
'hvac_action': <HVACAction.HEATING: 'heating'>,
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.FAN_ONLY: 'fan_only'>,