mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Add hvac_action attribute to iAqualink Thermostat climate entities (#107803)
* Update climate.py * Reorder if/else statements per @dcmeglio's suggestion * Don't infer state, actually read it from the underlying device * HVACAction has a HEATING state, not ON * Update homeassistant/components/iaqualink/climate.py --------- Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
parent
ceaf8f2402
commit
90575bc496
@ -6,11 +6,13 @@ import logging
|
||||
from typing import Any
|
||||
|
||||
from iaqualink.device import AqualinkThermostat
|
||||
from iaqualink.systems.iaqua.device import AqualinkState
|
||||
|
||||
from homeassistant.components.climate import (
|
||||
DOMAIN as CLIMATE_DOMAIN,
|
||||
ClimateEntity,
|
||||
ClimateEntityFeature,
|
||||
HVACAction,
|
||||
HVACMode,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
@ -82,6 +84,16 @@ class HassAqualinkThermostat(AqualinkEntity, ClimateEntity):
|
||||
else:
|
||||
_LOGGER.warning("Unknown operation mode: %s", hvac_mode)
|
||||
|
||||
@property
|
||||
def hvac_action(self) -> HVACAction:
|
||||
"""Return the current HVAC action."""
|
||||
state = AqualinkState(self.dev._heater.state)
|
||||
if state == AqualinkState.ON:
|
||||
return HVACAction.HEATING
|
||||
if state == AqualinkState.ENABLED:
|
||||
return HVACAction.IDLE
|
||||
return HVACAction.OFF
|
||||
|
||||
@property
|
||||
def target_temperature(self) -> float:
|
||||
"""Return the current target temperature."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user