Skip to content

Commit

Permalink
populate AC's action
Browse files Browse the repository at this point in the history
  • Loading branch information
hydazz committed Feb 5, 2025
1 parent 10f6e11 commit ec85dc9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions homeassistant/components/advantage_air/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
FAN_MEDIUM,
ClimateEntity,
ClimateEntityFeature,
HVACAction,
HVACMode,
)
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_WHOLE, UnitOfTemperature
Expand Down Expand Up @@ -49,6 +50,14 @@
ADVANTAGE_AIR_HEAT_TARGET = "myAutoHeatTargetTemp"
ADVANTAGE_AIR_COOL_TARGET = "myAutoCoolTargetTemp"
ADVANTAGE_AIR_MYFAN = "autoAA"
ADVANTAGE_AIR_MYAUTO_MODE_SET = "myAutoModeCurrentSetMode"

HVAC_ACTIONS = {
"cool": HVACAction.COOLING,
"heat": HVACAction.HEATING,
"vent": HVACAction.FAN,
"dry": HVACAction.DRYING,
}

HVAC_MODES = [
HVACMode.OFF,
Expand Down Expand Up @@ -175,6 +184,17 @@ def hvac_mode(self) -> HVACMode | None:
return ADVANTAGE_AIR_HVAC_MODES.get(self._ac["mode"])
return HVACMode.OFF

@property
def hvac_action(self) -> HVACAction | None:
"""Return the current running HVAC action."""
if self._ac["state"] == ADVANTAGE_AIR_STATE_OFF:
return HVACAction.OFF
if self._ac["mode"] == "myauto":
return HVAC_ACTIONS.get(
self._ac.get(ADVANTAGE_AIR_MYAUTO_MODE_SET, HVACAction.OFF)
)
return HVAC_ACTIONS.get(self._ac["mode"])

@property
def fan_mode(self) -> str | None:
"""Return the current fan modes."""
Expand Down

0 comments on commit ec85dc9

Please sign in to comment.