From e17a653cf0a84de374cc215737bfea11ded38fee Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk <11290930+bouwew@users.noreply.github.com> Date: Mon, 23 May 2022 10:59:10 +0200 Subject: [PATCH] Bump plugwise to v0.18.4 (#72263) --- homeassistant/components/plugwise/climate.py | 4 +--- .../components/plugwise/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- .../all_data.json | 5 ----- .../fixtures/anna_heatpump/all_data.json | 9 ++++----- tests/components/plugwise/test_climate.py | 19 ++++--------------- tests/components/plugwise/test_diagnostics.py | 5 ----- 8 files changed, 12 insertions(+), 36 deletions(-) diff --git a/homeassistant/components/plugwise/climate.py b/homeassistant/components/plugwise/climate.py index 09f5181090c..c74a1baa9be 100644 --- a/homeassistant/components/plugwise/climate.py +++ b/homeassistant/components/plugwise/climate.py @@ -105,6 +105,7 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity): return HVACAction.HEATING if heater_central_data["binary_sensors"].get("cooling_state"): return HVACAction.COOLING + return HVACAction.IDLE @property @@ -132,9 +133,6 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity): @plugwise_command async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None: """Set the hvac mode.""" - if hvac_mode == HVACMode.AUTO and not self.device.get("schedule_temperature"): - raise ValueError("Cannot set HVAC mode to Auto: No schedule available") - await self.coordinator.api.set_schedule_state( self.device["location"], self.device.get("last_used"), diff --git a/homeassistant/components/plugwise/manifest.json b/homeassistant/components/plugwise/manifest.json index abf6f27b3fa..2b7f21cd106 100644 --- a/homeassistant/components/plugwise/manifest.json +++ b/homeassistant/components/plugwise/manifest.json @@ -2,7 +2,7 @@ "domain": "plugwise", "name": "Plugwise", "documentation": "https://www.home-assistant.io/integrations/plugwise", - "requirements": ["plugwise==0.18.2"], + "requirements": ["plugwise==0.18.4"], "codeowners": ["@CoMPaTech", "@bouwew", "@brefra", "@frenck"], "zeroconf": ["_plugwise._tcp.local."], "config_flow": true, diff --git a/requirements_all.txt b/requirements_all.txt index 02a895c703a..28417beb21b 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1245,7 +1245,7 @@ plexauth==0.0.6 plexwebsocket==0.0.13 # homeassistant.components.plugwise -plugwise==0.18.2 +plugwise==0.18.4 # homeassistant.components.plum_lightpad plumlightpad==0.0.11 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index f7e948b333a..da7577fa7d3 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -847,7 +847,7 @@ plexauth==0.0.6 plexwebsocket==0.0.13 # homeassistant.components.plugwise -plugwise==0.18.2 +plugwise==0.18.4 # homeassistant.components.plum_lightpad plumlightpad==0.0.11 diff --git a/tests/components/plugwise/fixtures/adam_multiple_devices_per_zone/all_data.json b/tests/components/plugwise/fixtures/adam_multiple_devices_per_zone/all_data.json index 85e5abb0b17..6ef0716e4b6 100644 --- a/tests/components/plugwise/fixtures/adam_multiple_devices_per_zone/all_data.json +++ b/tests/components/plugwise/fixtures/adam_multiple_devices_per_zone/all_data.json @@ -34,7 +34,6 @@ ], "selected_schedule": "None", "last_used": "Badkamer Schema", - "schedule_temperature": 0.0, "mode": "heat", "sensors": { "temperature": 16.5, @@ -104,7 +103,6 @@ ], "selected_schedule": "GF7 Woonkamer", "last_used": "GF7 Woonkamer", - "schedule_temperature": 15.0, "mode": "auto", "sensors": { "temperature": 20.9, @@ -301,7 +299,6 @@ ], "selected_schedule": "CV Jessie", "last_used": "CV Jessie", - "schedule_temperature": 15.0, "mode": "auto", "sensors": { "temperature": 17.2, @@ -352,7 +349,6 @@ ], "selected_schedule": "Badkamer Schema", "last_used": "Badkamer Schema", - "schedule_temperature": 15.0, "mode": "auto", "sensors": { "temperature": 18.9, @@ -402,7 +398,6 @@ ], "selected_schedule": "None", "last_used": "Badkamer Schema", - "schedule_temperature": 0.0, "mode": "heat", "sensors": { "temperature": 15.6, diff --git a/tests/components/plugwise/fixtures/anna_heatpump/all_data.json b/tests/components/plugwise/fixtures/anna_heatpump/all_data.json index cc3f8d8f385..60bc4c35668 100644 --- a/tests/components/plugwise/fixtures/anna_heatpump/all_data.json +++ b/tests/components/plugwise/fixtures/anna_heatpump/all_data.json @@ -63,11 +63,10 @@ "resolution": 0.1, "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], "active_preset": "home", - "available_schedules": ["None"], - "selected_schedule": "None", - "last_used": null, - "schedule_temperature": null, - "mode": "heat", + "available_schedules": ["standaard"], + "selected_schedule": "standaard", + "last_used": "standaard", + "mode": "auto", "sensors": { "temperature": 19.3, "setpoint": 21.0, diff --git a/tests/components/plugwise/test_climate.py b/tests/components/plugwise/test_climate.py index 34a7ea50d34..bf110cd8a91 100644 --- a/tests/components/plugwise/test_climate.py +++ b/tests/components/plugwise/test_climate.py @@ -150,10 +150,11 @@ async def test_anna_climate_entity_attributes( """Test creation of anna climate device environment.""" state = hass.states.get("climate.anna") assert state - assert state.state == HVACMode.HEAT + assert state.state == HVACMode.AUTO assert state.attributes["hvac_modes"] == [ HVACMode.HEAT, HVACMode.COOL, + HVACMode.AUTO, ] assert "no_frost" in state.attributes["preset_modes"] assert "home" in state.attributes["preset_modes"] @@ -199,24 +200,12 @@ async def test_anna_climate_entity_climate_changes( await hass.services.async_call( "climate", "set_hvac_mode", - {"entity_id": "climate.anna", "hvac_mode": "heat_cool"}, + {"entity_id": "climate.anna", "hvac_mode": "heat"}, blocking=True, ) assert mock_smile_anna.set_temperature.call_count == 1 assert mock_smile_anna.set_schedule_state.call_count == 1 mock_smile_anna.set_schedule_state.assert_called_with( - "c784ee9fdab44e1395b8dee7d7a497d5", None, "off" + "c784ee9fdab44e1395b8dee7d7a497d5", "standaard", "off" ) - - # Auto mode is not available, no schedules - with pytest.raises(ValueError): - await hass.services.async_call( - "climate", - "set_hvac_mode", - {"entity_id": "climate.anna", "hvac_mode": "auto"}, - blocking=True, - ) - - assert mock_smile_anna.set_temperature.call_count == 1 - assert mock_smile_anna.set_schedule_state.call_count == 1 diff --git a/tests/components/plugwise/test_diagnostics.py b/tests/components/plugwise/test_diagnostics.py index c2bb91746ae..372f410cd81 100644 --- a/tests/components/plugwise/test_diagnostics.py +++ b/tests/components/plugwise/test_diagnostics.py @@ -54,7 +54,6 @@ async def test_diagnostics( ], "selected_schedule": "None", "last_used": "Badkamer Schema", - "schedule_temperature": 0.0, "mode": "heat", "sensors": {"temperature": 16.5, "setpoint": 13.0, "battery": 67}, }, @@ -120,7 +119,6 @@ async def test_diagnostics( ], "selected_schedule": "GF7 Woonkamer", "last_used": "GF7 Woonkamer", - "schedule_temperature": 15.0, "mode": "auto", "sensors": {"temperature": 20.9, "setpoint": 21.5, "battery": 34}, }, @@ -290,7 +288,6 @@ async def test_diagnostics( ], "selected_schedule": "CV Jessie", "last_used": "CV Jessie", - "schedule_temperature": 15.0, "mode": "auto", "sensors": {"temperature": 17.2, "setpoint": 15.0, "battery": 37}, }, @@ -337,7 +334,6 @@ async def test_diagnostics( ], "selected_schedule": "Badkamer Schema", "last_used": "Badkamer Schema", - "schedule_temperature": 15.0, "mode": "auto", "sensors": {"temperature": 18.9, "setpoint": 14.0, "battery": 92}, }, @@ -380,7 +376,6 @@ async def test_diagnostics( ], "selected_schedule": "None", "last_used": "Badkamer Schema", - "schedule_temperature": 0.0, "mode": "heat", "sensors": { "temperature": 15.6,