diff --git a/homeassistant/components/plugwise/climate.py b/homeassistant/components/plugwise/climate.py index 006cfbe87da..29d44fe8159 100644 --- a/homeassistant/components/plugwise/climate.py +++ b/homeassistant/components/plugwise/climate.py @@ -155,7 +155,7 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity): if "regulation_modes" in self.gateway_data: hvac_modes.append(HVACMode.OFF) - if self.device["available_schedules"] != ["None"]: + if "available_schedules" in self.device: hvac_modes.append(HVACMode.AUTO) if self.cdr_gateway["cooling_present"]: diff --git a/homeassistant/components/plugwise/manifest.json b/homeassistant/components/plugwise/manifest.json index b1937ee219d..10faf75d0f1 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==0.37.4.1"], + "requirements": ["plugwise==0.38.3"], "zeroconf": ["_plugwise._tcp.local."] } diff --git a/homeassistant/components/plugwise/number.py b/homeassistant/components/plugwise/number.py index f00b9e38876..c84ca2cf5c7 100644 --- a/homeassistant/components/plugwise/number.py +++ b/homeassistant/components/plugwise/number.py @@ -35,8 +35,8 @@ NUMBER_TYPES = ( PlugwiseNumberEntityDescription( key="maximum_boiler_temperature", translation_key="maximum_boiler_temperature", - command=lambda api, number, dev_id, value: api.set_number_setpoint( - number, dev_id, value + command=lambda api, dev_id, number, value: api.set_number( + dev_id, number, value ), device_class=NumberDeviceClass.TEMPERATURE, entity_category=EntityCategory.CONFIG, @@ -45,8 +45,8 @@ NUMBER_TYPES = ( PlugwiseNumberEntityDescription( key="max_dhw_temperature", translation_key="max_dhw_temperature", - command=lambda api, number, dev_id, value: api.set_number_setpoint( - number, dev_id, value + command=lambda api, dev_id, number, value: api.set_number( + dev_id, number, value ), device_class=NumberDeviceClass.TEMPERATURE, entity_category=EntityCategory.CONFIG, @@ -55,8 +55,8 @@ NUMBER_TYPES = ( PlugwiseNumberEntityDescription( key="temperature_offset", translation_key="temperature_offset", - command=lambda api, number, dev_id, value: api.set_temperature_offset( - number, dev_id, value + command=lambda api, dev_id, number, value: api.set_temperature_offset( + dev_id, value ), device_class=NumberDeviceClass.TEMPERATURE, entity_category=EntityCategory.CONFIG, @@ -124,6 +124,6 @@ class PlugwiseNumberEntity(PlugwiseEntity, NumberEntity): async def async_set_native_value(self, value: float) -> None: """Change to the new setpoint value.""" await self.entity_description.command( - self.coordinator.api, self.entity_description.key, self.device_id, value + self.coordinator.api, self.device_id, self.entity_description.key, value ) await self.coordinator.async_request_refresh() diff --git a/requirements_all.txt b/requirements_all.txt index a1ce60412ba..d65267ea5f6 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1575,7 +1575,7 @@ plexauth==0.0.6 plexwebsocket==0.0.14 # homeassistant.components.plugwise -plugwise==0.37.4.1 +plugwise==0.38.3 # homeassistant.components.plum_lightpad plumlightpad==0.0.11 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 7e1316c8b74..02ec3650970 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1258,7 +1258,7 @@ plexauth==0.0.6 plexwebsocket==0.0.14 # homeassistant.components.plugwise -plugwise==0.37.4.1 +plugwise==0.38.3 # 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 47c8e4dceb0..9c17df5072d 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 @@ -479,6 +479,7 @@ "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." } }, + "reboot": true, "smile_name": "Adam" } } diff --git a/tests/components/plugwise/fixtures/anna_heatpump_heating/all_data.json b/tests/components/plugwise/fixtures/anna_heatpump_heating/all_data.json index d496edb4149..5088281404a 100644 --- a/tests/components/plugwise/fixtures/anna_heatpump_heating/all_data.json +++ b/tests/components/plugwise/fixtures/anna_heatpump_heating/all_data.json @@ -99,6 +99,7 @@ "heater_id": "1cbf783bb11e4a7c8a6843dee3a86927", "item_count": 66, "notifications": {}, + "reboot": true, "smile_name": "Smile Anna" } } diff --git a/tests/components/plugwise/fixtures/m_adam_cooling/all_data.json b/tests/components/plugwise/fixtures/m_adam_cooling/all_data.json index 6cd3241a637..759d0094dbb 100644 --- a/tests/components/plugwise/fixtures/m_adam_cooling/all_data.json +++ b/tests/components/plugwise/fixtures/m_adam_cooling/all_data.json @@ -66,7 +66,7 @@ "model": "ThermoTouch", "name": "Anna", "preset_modes": ["no_frost", "asleep", "vacation", "home", "away"], - "select_schedule": "None", + "select_schedule": "off", "sensors": { "setpoint": 23.5, "temperature": 25.8 @@ -165,6 +165,7 @@ "heater_id": "056ee145a816487eaa69243c3280f8bf", "item_count": 147, "notifications": {}, + "reboot": true, "smile_name": "Adam" } } 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 0e9df1a5079..e2c23df42d6 100644 --- a/tests/components/plugwise/fixtures/m_adam_heating/all_data.json +++ b/tests/components/plugwise/fixtures/m_adam_heating/all_data.json @@ -71,7 +71,7 @@ "model": "ThermoTouch", "name": "Anna", "preset_modes": ["no_frost", "asleep", "vacation", "home", "away"], - "select_schedule": "None", + "select_schedule": "off", "sensors": { "setpoint": 20.0, "temperature": 19.1 @@ -164,6 +164,7 @@ "heater_id": "056ee145a816487eaa69243c3280f8bf", "item_count": 147, "notifications": {}, + "reboot": true, "smile_name": "Adam" } } 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 378a5e0a760..7888d777804 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,6 @@ "1346fbd8498d4dbcab7e18d51b771f3d": { "active_preset": "no_frost", "available": true, - "available_schedules": ["None"], "control_state": "off", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", @@ -13,7 +12,6 @@ "model": "Lisa", "name": "Slaapkamer", "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], - "select_schedule": "None", "sensors": { "battery": 92, "setpoint": 13.0, @@ -99,7 +97,6 @@ "6f3e9d7084214c21b9dfa46f6eeb8700": { "active_preset": "home", "available": true, - "available_schedules": ["None"], "control_state": "off", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", @@ -109,7 +106,6 @@ "model": "Lisa", "name": "Kinderkamer", "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], - "select_schedule": "None", "sensors": { "battery": 79, "setpoint": 13.0, @@ -156,7 +152,6 @@ "a6abc6a129ee499c88a4d420cc413b47": { "active_preset": "home", "available": true, - "available_schedules": ["None"], "control_state": "off", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", @@ -166,7 +161,6 @@ "model": "Lisa", "name": "Logeerkamer", "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], - "select_schedule": "None", "sensors": { "battery": 80, "setpoint": 13.0, @@ -269,7 +263,6 @@ "f61f1a2535f54f52ad006a3d18e459ca": { "active_preset": "home", "available": true, - "available_schedules": ["None"], "control_state": "off", "dev_class": "zone_thermometer", "firmware": "2020-09-01T02:00:00+02:00", @@ -279,7 +272,6 @@ "model": "Jip", "name": "Woonkamer", "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], - "select_schedule": "None", "sensors": { "battery": 100, "humidity": 56.2, @@ -306,8 +298,9 @@ "cooling_present": false, "gateway_id": "b5c2386c6f6342669e50fe49dd05b188", "heater_id": "e4684553153b44afbef2200885f379dc", - "item_count": 221, + "item_count": 213, "notifications": {}, + "reboot": true, "smile_name": "Adam" } } diff --git a/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/all_data.json b/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/all_data.json index ef7af8a362b..cb30b919797 100644 --- a/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/all_data.json +++ b/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/all_data.json @@ -99,6 +99,7 @@ "heater_id": "1cbf783bb11e4a7c8a6843dee3a86927", "item_count": 66, "notifications": {}, + "reboot": true, "smile_name": "Smile Anna" } } diff --git a/tests/components/plugwise/fixtures/m_anna_heatpump_idle/all_data.json b/tests/components/plugwise/fixtures/m_anna_heatpump_idle/all_data.json index 8f2e6a75f3f..660f6b5a76b 100644 --- a/tests/components/plugwise/fixtures/m_anna_heatpump_idle/all_data.json +++ b/tests/components/plugwise/fixtures/m_anna_heatpump_idle/all_data.json @@ -99,6 +99,7 @@ "heater_id": "1cbf783bb11e4a7c8a6843dee3a86927", "item_count": 66, "notifications": {}, + "reboot": true, "smile_name": "Smile Anna" } } diff --git a/tests/components/plugwise/fixtures/p1v4_442_single/all_data.json b/tests/components/plugwise/fixtures/p1v4_442_single/all_data.json index 318035a5d2c..7f152779252 100644 --- a/tests/components/plugwise/fixtures/p1v4_442_single/all_data.json +++ b/tests/components/plugwise/fixtures/p1v4_442_single/all_data.json @@ -44,6 +44,7 @@ "gateway_id": "a455b61e52394b2db5081ce025a430f3", "item_count": 31, "notifications": {}, + "reboot": true, "smile_name": "Smile P1" } } diff --git a/tests/components/plugwise/fixtures/p1v4_442_triple/all_data.json b/tests/components/plugwise/fixtures/p1v4_442_triple/all_data.json index ecda8049163..582c883a3a7 100644 --- a/tests/components/plugwise/fixtures/p1v4_442_triple/all_data.json +++ b/tests/components/plugwise/fixtures/p1v4_442_triple/all_data.json @@ -57,6 +57,7 @@ "warning": "The Smile P1 is not connected to a smart meter." } }, + "reboot": true, "smile_name": "Smile P1" } } diff --git a/tests/components/plugwise/snapshots/test_diagnostics.ambr b/tests/components/plugwise/snapshots/test_diagnostics.ambr index 0fa3df4e660..44f4023d014 100644 --- a/tests/components/plugwise/snapshots/test_diagnostics.ambr +++ b/tests/components/plugwise/snapshots/test_diagnostics.ambr @@ -511,6 +511,7 @@ '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.", }), }), + 'reboot': True, 'smile_name': 'Adam', }), }) diff --git a/tests/components/plugwise/test_climate.py b/tests/components/plugwise/test_climate.py index 5cdc468a957..b3f42031ed8 100644 --- a/tests/components/plugwise/test_climate.py +++ b/tests/components/plugwise/test_climate.py @@ -395,7 +395,7 @@ async def test_anna_climate_entity_climate_changes( "c784ee9fdab44e1395b8dee7d7a497d5", "off" ) data = mock_smile_anna.async_update.return_value - data.devices["3cb70739631c4d17a86b8b12e8a5161b"]["available_schedules"] = ["None"] + data.devices["3cb70739631c4d17a86b8b12e8a5161b"].pop("available_schedules") with patch(HA_PLUGWISE_SMILE_ASYNC_UPDATE, return_value=data): async_fire_time_changed(hass, utcnow() + timedelta(minutes=1)) await hass.async_block_till_done() diff --git a/tests/components/plugwise/test_number.py b/tests/components/plugwise/test_number.py index 6fa65b3e65a..8d49d07b9fb 100644 --- a/tests/components/plugwise/test_number.py +++ b/tests/components/plugwise/test_number.py @@ -36,9 +36,9 @@ async def test_anna_max_boiler_temp_change( blocking=True, ) - assert mock_smile_anna.set_number_setpoint.call_count == 1 - mock_smile_anna.set_number_setpoint.assert_called_with( - "maximum_boiler_temperature", "1cbf783bb11e4a7c8a6843dee3a86927", 65.0 + assert mock_smile_anna.set_number.call_count == 1 + mock_smile_anna.set_number.assert_called_with( + "1cbf783bb11e4a7c8a6843dee3a86927", "maximum_boiler_temperature", 65.0 ) @@ -65,9 +65,9 @@ async def test_adam_dhw_setpoint_change( blocking=True, ) - assert mock_smile_adam_2.set_number_setpoint.call_count == 1 - mock_smile_adam_2.set_number_setpoint.assert_called_with( - "max_dhw_temperature", "056ee145a816487eaa69243c3280f8bf", 55.0 + assert mock_smile_adam_2.set_number.call_count == 1 + mock_smile_adam_2.set_number.assert_called_with( + "056ee145a816487eaa69243c3280f8bf", "max_dhw_temperature", 55.0 ) @@ -99,5 +99,5 @@ async def test_adam_temperature_offset_change( assert mock_smile_adam.set_temperature_offset.call_count == 1 mock_smile_adam.set_temperature_offset.assert_called_with( - "temperature_offset", "6a3bf693d05e48e0b460c815a4fdd09d", 1.0 + "6a3bf693d05e48e0b460c815a4fdd09d", 1.0 )