Add hvac_action to HomematicIP Cloud Climate (#28859)

* Add hvac_action to HomematicIP Cloud Climate

* update test data

* limit hvac action to radiator only

* add checks

* Fix test to match new conditions
This commit is contained in:
SukramJ authored and Paulus Schoutsen committed 2019-11-26 10:02:30 -08:00
1 parent d0c47dfee2
commit c1163283ff
2 files changed
+34

No files matched your search

@@ -10,6 +10,8 @@ from homematicip.functionalHomes import IndoorClimateHome
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
HVAC_MODE_AUTO,
HVAC_MODE_COOL,
HVAC_MODE_HEAT,
@@ -140,6 +142,24 @@ class HomematicipHeatingGroup(HomematicipGenericDevice, ClimateDevice):
else [HVAC_MODE_AUTO, HVAC_MODE_COOL]
)
@property
def hvac_action(self) -> Optional[str]:
"""
Return the current hvac_action.
This is only relevant for radiator thermostats.
"""
if (
self._device.floorHeatingMode == "RADIATOR"
and self._has_radiator_thermostat
and self._heat_mode_enabled
):
return (
CURRENT_HVAC_HEAT if self._device.valvePosition else CURRENT_HVAC_IDLE
)
return None
@property
def preset_mode(self) -> Optional[str]:
"""Return the current preset mode."""