diff --git a/homeassistant/components/plugwise/climate.py b/homeassistant/components/plugwise/climate.py index b27fd1d4f0ef86..64c4c91900ca4a 100644 --- a/homeassistant/components/plugwise/climate.py +++ b/homeassistant/components/plugwise/climate.py @@ -188,17 +188,8 @@ def hvac_action(self) -> HVACAction: self._previous_action_mode(self.coordinator) # Adam provides the hvac_action for each thermostat - if self._gateway["smile_name"] == "Adam": - if (control_state := self.device.get("control_state")) == "cooling": - return HVACAction.COOLING - if control_state == "heating": - return HVACAction.HEATING - if control_state == "preheating": - return HVACAction.PREHEATING - if control_state == "off": - return HVACAction.IDLE - - return HVACAction.IDLE + if (action := self.device.get("control_state")) is not None: + return HVACAction(action) # Anna heater: str = self._gateway["heater_id"] diff --git a/homeassistant/components/plugwise/manifest.json b/homeassistant/components/plugwise/manifest.json index df35777ac54a75..d7fcec3bbae91f 100644 --- a/homeassistant/components/plugwise/manifest.json +++ b/homeassistant/components/plugwise/manifest.json @@ -7,6 +7,6 @@ "integration_type": "hub", "iot_class": "local_polling", "loggers": ["plugwise"], - "requirements": ["plugwise==1.6.1"], + "requirements": ["plugwise==1.6.2"], "zeroconf": ["_plugwise._tcp.local."] } diff --git a/requirements_all.txt b/requirements_all.txt index fcd28e2bc1a72d..1e34a4b30ef71e 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1622,7 +1622,7 @@ plexauth==0.0.6 plexwebsocket==0.0.14 # homeassistant.components.plugwise -plugwise==1.6.1 +plugwise==1.6.2 # homeassistant.components.plum_lightpad plumlightpad==0.0.11 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 4d06bbf79dd8c7..e6c809b820004a 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1332,7 +1332,7 @@ plexauth==0.0.6 plexwebsocket==0.0.14 # homeassistant.components.plugwise -plugwise==1.6.1 +plugwise==1.6.2 # homeassistant.components.plum_lightpad plumlightpad==0.0.11 diff --git a/tests/components/plugwise/fixtures/m_adam_heating/all_data.json b/tests/components/plugwise/fixtures/m_adam_heating/all_data.json index fab2cea5fdc6b1..bb24faeebfa026 100644 --- a/tests/components/plugwise/fixtures/m_adam_heating/all_data.json +++ b/tests/components/plugwise/fixtures/m_adam_heating/all_data.json @@ -176,7 +176,7 @@ "off" ], "climate_mode": "auto", - "control_state": "off", + "control_state": "idle", "dev_class": "climate", "model": "ThermoZone", "name": "Bathroom", diff --git a/tests/components/plugwise/fixtures/m_adam_jip/all_data.json b/tests/components/plugwise/fixtures/m_adam_jip/all_data.json index 4516ce2c2d0d2d..1ca9e77010f409 100644 --- a/tests/components/plugwise/fixtures/m_adam_jip/all_data.json +++ b/tests/components/plugwise/fixtures/m_adam_jip/all_data.json @@ -3,7 +3,7 @@ "06aecb3d00354375924f50c47af36bd2": { "active_preset": "no_frost", "climate_mode": "off", - "control_state": "off", + "control_state": "idle", "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer", @@ -26,7 +26,7 @@ "13228dab8ce04617af318a2888b3c548": { "active_preset": "home", "climate_mode": "heat", - "control_state": "off", + "control_state": "idle", "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", @@ -238,7 +238,7 @@ "d27aede973b54be484f6842d1b2802ad": { "active_preset": "home", "climate_mode": "heat", - "control_state": "off", + "control_state": "idle", "dev_class": "climate", "model": "ThermoZone", "name": "Kinderkamer", @@ -285,7 +285,7 @@ "d58fec52899f4f1c92e4f8fad6d8c48c": { "active_preset": "home", "climate_mode": "heat", - "control_state": "off", + "control_state": "idle", "dev_class": "climate", "model": "ThermoZone", "name": "Logeerkamer", diff --git a/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/all_data.json b/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/all_data.json index 67e8c235cc3b96..8da184a7a3e9f7 100644 --- a/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/all_data.json +++ b/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/all_data.json @@ -32,6 +32,7 @@ "off" ], "climate_mode": "auto", + "control_state": "idle", "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer", @@ -66,6 +67,7 @@ "off" ], "climate_mode": "heat", + "control_state": "idle", "dev_class": "climate", "model": "ThermoZone", "name": "Bios", @@ -112,6 +114,7 @@ "446ac08dd04d4eff8ac57489757b7314": { "active_preset": "no_frost", "climate_mode": "heat", + "control_state": "idle", "dev_class": "climate", "model": "ThermoZone", "name": "Garage", @@ -258,6 +261,7 @@ "off" ], "climate_mode": "auto", + "control_state": "idle", "dev_class": "climate", "model": "ThermoZone", "name": "Jessie", @@ -402,6 +406,7 @@ "off" ], "climate_mode": "auto", + "control_state": "heating", "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", @@ -577,7 +582,7 @@ "cooling_present": false, "gateway_id": "fe799307f1624099878210aa0b9f1475", "heater_id": "90986d591dcd426cae3ec3e8111ff730", - "item_count": 364, + "item_count": 369, "notifications": { "af82e4ccf9c548528166d38e560662a4": { "warning": "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device." diff --git a/tests/components/plugwise/snapshots/test_diagnostics.ambr b/tests/components/plugwise/snapshots/test_diagnostics.ambr index bf7d4260a32c6b..806c92fe7cb7f9 100644 --- a/tests/components/plugwise/snapshots/test_diagnostics.ambr +++ b/tests/components/plugwise/snapshots/test_diagnostics.ambr @@ -34,6 +34,7 @@ 'off', ]), 'climate_mode': 'auto', + 'control_state': 'idle', 'dev_class': 'climate', 'model': 'ThermoZone', 'name': 'Badkamer', @@ -75,6 +76,7 @@ 'off', ]), 'climate_mode': 'heat', + 'control_state': 'idle', 'dev_class': 'climate', 'model': 'ThermoZone', 'name': 'Bios', @@ -131,6 +133,7 @@ '446ac08dd04d4eff8ac57489757b7314': dict({ 'active_preset': 'no_frost', 'climate_mode': 'heat', + 'control_state': 'idle', 'dev_class': 'climate', 'model': 'ThermoZone', 'name': 'Garage', @@ -286,6 +289,7 @@ 'off', ]), 'climate_mode': 'auto', + 'control_state': 'idle', 'dev_class': 'climate', 'model': 'ThermoZone', 'name': 'Jessie', @@ -440,6 +444,7 @@ 'off', ]), 'climate_mode': 'auto', + 'control_state': 'heating', 'dev_class': 'climate', 'model': 'ThermoZone', 'name': 'Woonkamer', @@ -625,7 +630,7 @@ 'cooling_present': False, 'gateway_id': 'fe799307f1624099878210aa0b9f1475', 'heater_id': '90986d591dcd426cae3ec3e8111ff730', - 'item_count': 364, + 'item_count': 369, 'notifications': dict({ 'af82e4ccf9c548528166d38e560662a4': dict({ 'warning': "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device.", diff --git a/tests/components/plugwise/test_climate.py b/tests/components/plugwise/test_climate.py index c0c1c00c68dbc3..17c4300e6850b4 100644 --- a/tests/components/plugwise/test_climate.py +++ b/tests/components/plugwise/test_climate.py @@ -31,15 +31,13 @@ async def test_adam_climate_entity_attributes( state = hass.states.get("climate.woonkamer") assert state assert state.state == HVACMode.AUTO + assert state.attributes["hvac_action"] == "heating" assert state.attributes["hvac_modes"] == [HVACMode.AUTO, HVACMode.HEAT] - # hvac_action is not asserted as the fixture is not in line with recent firmware functionality - assert "preset_modes" in state.attributes assert "no_frost" in state.attributes["preset_modes"] assert "home" in state.attributes["preset_modes"] - - assert state.attributes["current_temperature"] == 20.9 assert state.attributes["preset_mode"] == "home" + assert state.attributes["current_temperature"] == 20.9 assert state.attributes["supported_features"] == 17 assert state.attributes["temperature"] == 21.5 assert state.attributes["min_temp"] == 0.0 @@ -49,15 +47,13 @@ async def test_adam_climate_entity_attributes( state = hass.states.get("climate.jessie") assert state assert state.state == HVACMode.AUTO + assert state.attributes["hvac_action"] == "idle" assert state.attributes["hvac_modes"] == [HVACMode.AUTO, HVACMode.HEAT] - # hvac_action is not asserted as the fixture is not in line with recent firmware functionality - assert "preset_modes" in state.attributes assert "no_frost" in state.attributes["preset_modes"] assert "home" in state.attributes["preset_modes"] - - assert state.attributes["current_temperature"] == 17.2 assert state.attributes["preset_mode"] == "asleep" + assert state.attributes["current_temperature"] == 17.2 assert state.attributes["temperature"] == 15.0 assert state.attributes["min_temp"] == 0.0 assert state.attributes["max_temp"] == 35.0