diff --git a/homeassistant/components/plugwise/climate.py b/homeassistant/components/plugwise/climate.py index baa004e688d..7981283f27d 100644 --- a/homeassistant/components/plugwise/climate.py +++ b/homeassistant/components/plugwise/climate.py @@ -114,10 +114,9 @@ class PwThermostat(SmileGateway, ClimateEntity): if self._cooling_state: return CURRENT_HVAC_COOL return CURRENT_HVAC_IDLE - if self._heating_state is not None: - if self._setpoint > self._temperature: - return CURRENT_HVAC_HEAT - return CURRENT_HVAC_IDLE + if self._setpoint > self._temperature: + return CURRENT_HVAC_HEAT + return CURRENT_HVAC_IDLE @property def supported_features(self): @@ -142,10 +141,9 @@ class PwThermostat(SmileGateway, ClimateEntity): @property def hvac_modes(self): """Return the available hvac modes list.""" - if self._heating_state is not None: - if self._compressor_state is not None: - return HVAC_MODES_HEAT_COOL - return HVAC_MODES_HEAT_ONLY + if self._compressor_state is not None: + return HVAC_MODES_HEAT_COOL + return HVAC_MODES_HEAT_ONLY @property def hvac_mode(self): @@ -263,11 +261,11 @@ class PwThermostat(SmileGateway, ClimateEntity): if heater_central_data.get("compressor_state") is not None: self._compressor_state = heater_central_data["compressor_state"] + self._hvac_mode = HVAC_MODE_HEAT + if self._compressor_state is not None: + self._hvac_mode = HVAC_MODE_HEAT_COOL + if self._schema_status: self._hvac_mode = HVAC_MODE_AUTO - elif self._heating_state is not None: - self._hvac_mode = HVAC_MODE_HEAT - if self._compressor_state is not None: - self._hvac_mode = HVAC_MODE_HEAT_COOL self.async_write_ha_state() diff --git a/homeassistant/components/plugwise/manifest.json b/homeassistant/components/plugwise/manifest.json index 222db34b344..f431ce9ee97 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_Smile==1.5.1"], + "requirements": ["Plugwise_Smile==1.6.0"], "codeowners": ["@CoMPaTech", "@bouwew"], "zeroconf": ["_plugwise._tcp.local."], "config_flow": true diff --git a/requirements_all.txt b/requirements_all.txt index 7dfc6d814e7..bc5f2ead0ef 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -26,7 +26,7 @@ Mastodon.py==1.5.1 OPi.GPIO==0.4.0 # homeassistant.components.plugwise -Plugwise_Smile==1.5.1 +Plugwise_Smile==1.6.0 # homeassistant.components.essent PyEssent==0.13 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index eaa80448ffb..6e987726779 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -7,7 +7,7 @@ HAP-python==3.0.0 # homeassistant.components.plugwise -Plugwise_Smile==1.5.1 +Plugwise_Smile==1.6.0 # homeassistant.components.flick_electric PyFlick==0.0.2 diff --git a/tests/components/plugwise/conftest.py b/tests/components/plugwise/conftest.py index 1d2a6c9cf32..5af2bf2ccd3 100644 --- a/tests/components/plugwise/conftest.py +++ b/tests/components/plugwise/conftest.py @@ -80,7 +80,7 @@ def mock_smile_adam(): return_value=True ) smile_mock.return_value.single_master_thermostat.side_effect = Mock( - return_value=True + return_value=False ) smile_mock.return_value.set_schedule_state.side_effect = AsyncMock( return_value=True diff --git a/tests/components/plugwise/test_climate.py b/tests/components/plugwise/test_climate.py index 02375b49709..7c74d970d7e 100644 --- a/tests/components/plugwise/test_climate.py +++ b/tests/components/plugwise/test_climate.py @@ -13,7 +13,7 @@ async def test_adam_climate_entity_attributes(hass, mock_smile_adam): state = hass.states.get("climate.zone_lisa_wk") attrs = state.attributes - assert attrs["hvac_modes"] is None + assert attrs["hvac_modes"] == ["heat", "auto"] assert "preset_modes" in attrs assert "no_frost" in attrs["preset_modes"] @@ -29,7 +29,7 @@ async def test_adam_climate_entity_attributes(hass, mock_smile_adam): state = hass.states.get("climate.zone_thermostat_jessie") attrs = state.attributes - assert attrs["hvac_modes"] is None + assert attrs["hvac_modes"] == ["heat", "auto"] assert "preset_modes" in attrs assert "no_frost" in attrs["preset_modes"]