mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Add hvac_action to geniushub (#28056)
* add hvac_action() to climate zones
This commit is contained in:
parent
ac467d0b3f
commit
269c8f1d14
@ -3,6 +3,9 @@ from typing import List, Optional
|
|||||||
|
|
||||||
from homeassistant.components.climate import ClimateDevice
|
from homeassistant.components.climate import ClimateDevice
|
||||||
from homeassistant.components.climate.const import (
|
from homeassistant.components.climate.const import (
|
||||||
|
CURRENT_HVAC_HEAT,
|
||||||
|
CURRENT_HVAC_IDLE,
|
||||||
|
CURRENT_HVAC_OFF,
|
||||||
HVAC_MODE_HEAT,
|
HVAC_MODE_HEAT,
|
||||||
HVAC_MODE_OFF,
|
HVAC_MODE_OFF,
|
||||||
PRESET_ACTIVITY,
|
PRESET_ACTIVITY,
|
||||||
@ -68,6 +71,17 @@ class GeniusClimateZone(GeniusZone, ClimateDevice):
|
|||||||
"""Return the list of available hvac operation modes."""
|
"""Return the list of available hvac operation modes."""
|
||||||
return list(HA_HVAC_TO_GH)
|
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
|
@property
|
||||||
def preset_mode(self) -> Optional[str]:
|
def preset_mode(self) -> Optional[str]:
|
||||||
"""Return the current preset mode, e.g., home, away, temp."""
|
"""Return the current preset mode, e.g., home, away, temp."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user