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

@@ -7,8 +7,11 @@ from homematicip.functionalHomes import IndoorClimateHome
from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN
from homeassistant.components.climate.const import (
ATTR_CURRENT_TEMPERATURE,
ATTR_HVAC_ACTION,
ATTR_PRESET_MODE,
ATTR_PRESET_MODES,
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
HVAC_MODE_AUTO,
HVAC_MODE_COOL,
HVAC_MODE_HEAT,
@@ -215,6 +218,17 @@ async def test_hmip_heating_group_heat(hass, default_mock_hap):
# Only fire event from last async_manipulate_test_data available.
assert hmip_device.mock_calls[-1][0] == "fire_update_event"
await async_manipulate_test_data(hass, hmip_device, "floorHeatingMode", "RADIATOR")
await async_manipulate_test_data(hass, hmip_device, "valvePosition", 0.1)
ha_state = hass.states.get(entity_id)
assert ha_state.state == HVAC_MODE_AUTO
assert ha_state.attributes[ATTR_HVAC_ACTION] == CURRENT_HVAC_HEAT
await async_manipulate_test_data(hass, hmip_device, "floorHeatingMode", "RADIATOR")
await async_manipulate_test_data(hass, hmip_device, "valvePosition", 0.0)
ha_state = hass.states.get(entity_id)
assert ha_state.state == HVAC_MODE_AUTO
assert ha_state.attributes[ATTR_HVAC_ACTION] == CURRENT_HVAC_IDLE
async def test_hmip_heating_group_cool(hass, default_mock_hap):
"""Test HomematicipHeatingGroup."""