Skip to content

Commit ec85dc9

Browse files
committed
populate AC's action
1 parent 10f6e11 commit ec85dc9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

homeassistant/components/advantage_air/climate.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
FAN_MEDIUM,
1515
ClimateEntity,
1616
ClimateEntityFeature,
17+
HVACAction,
1718
HVACMode,
1819
)
1920
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_WHOLE, UnitOfTemperature
@@ -49,6 +50,14 @@
4950
ADVANTAGE_AIR_HEAT_TARGET = "myAutoHeatTargetTemp"
5051
ADVANTAGE_AIR_COOL_TARGET = "myAutoCoolTargetTemp"
5152
ADVANTAGE_AIR_MYFAN = "autoAA"
53+
ADVANTAGE_AIR_MYAUTO_MODE_SET = "myAutoModeCurrentSetMode"
54+
55+
HVAC_ACTIONS = {
56+
"cool": HVACAction.COOLING,
57+
"heat": HVACAction.HEATING,
58+
"vent": HVACAction.FAN,
59+
"dry": HVACAction.DRYING,
60+
}
5261

5362
HVAC_MODES = [
5463
HVACMode.OFF,
@@ -175,6 +184,17 @@ def hvac_mode(self) -> HVACMode | None:
175184
return ADVANTAGE_AIR_HVAC_MODES.get(self._ac["mode"])
176185
return HVACMode.OFF
177186

187+
@property
188+
def hvac_action(self) -> HVACAction | None:
189+
"""Return the current running HVAC action."""
190+
if self._ac["state"] == ADVANTAGE_AIR_STATE_OFF:
191+
return HVACAction.OFF
192+
if self._ac["mode"] == "myauto":
193+
return HVAC_ACTIONS.get(
194+
self._ac.get(ADVANTAGE_AIR_MYAUTO_MODE_SET, HVACAction.OFF)
195+
)
196+
return HVAC_ACTIONS.get(self._ac["mode"])
197+
178198
@property
179199
def fan_mode(self) -> str | None:
180200
"""Return the current fan modes."""

0 commit comments

Comments
 (0)