Add hvac_action to geniushub (#28056)
* add hvac_action() to climate zones
This commit is contained in:
parent
ac467d0b3f
commit
269c8f1d14
1 changed files with 14 additions and 0 deletions
|
@ -3,6 +3,9 @@ from typing import List, Optional
|
|||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_HEAT,
|
||||
CURRENT_HVAC_IDLE,
|
||||
CURRENT_HVAC_OFF,
|
||||
HVAC_MODE_HEAT,
|
||||
HVAC_MODE_OFF,
|
||||
PRESET_ACTIVITY,
|
||||
|
@ -68,6 +71,17 @@ class GeniusClimateZone(GeniusZone, ClimateDevice):
|
|||
"""Return the list of available hvac operation modes."""
|
||||
return list(HA_HVAC_TO_GH)
|
||||
|
||||
@property
|
||||
def hvac_action(self) -> Optional[str]:
|
||||
"""Return the current running hvac operation if supported."""
|
||||
if "_state" in self._zone.data: # only for v3 API
|
||||
if not self._zone.data["_state"].get("bIsActive"):
|
||||
return CURRENT_HVAC_OFF
|
||||
if self._zone.data["_state"].get("bOutRequestHeat"):
|
||||
return CURRENT_HVAC_HEAT
|
||||
return CURRENT_HVAC_IDLE
|
||||
return None
|
||||
|
||||
@property
|
||||
def preset_mode(self) -> Optional[str]:
|
||||
"""Return the current preset mode, e.g., home, away, temp."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue