Skip to content

Commit

Permalink
Bump plugwise to v0.38.3 (home-assistant#120152)
Browse files Browse the repository at this point in the history
  • Loading branch information
bouwew authored Jun 23, 2024
1 parent f0d5640 commit f257fcb
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 30 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/plugwise/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def hvac_modes(self) -> list[HVACMode]:
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"]:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/plugwise/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."]
}
14 changes: 7 additions & 7 deletions homeassistant/components/plugwise/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class PlugwiseNumberEntityDescription(NumberEntityDescription):
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,
Expand All @@ -45,8 +45,8 @@ class PlugwiseNumberEntityDescription(NumberEntityDescription):
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,
Expand All @@ -55,8 +55,8 @@ class PlugwiseNumberEntityDescription(NumberEntityDescription):
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,
Expand Down Expand Up @@ -124,6 +124,6 @@ def native_value(self) -> float:
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()
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"heater_id": "1cbf783bb11e4a7c8a6843dee3a86927",
"item_count": 66,
"notifications": {},
"reboot": true,
"smile_name": "Smile Anna"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -165,6 +165,7 @@
"heater_id": "056ee145a816487eaa69243c3280f8bf",
"item_count": 147,
"notifications": {},
"reboot": true,
"smile_name": "Adam"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -164,6 +164,7 @@
"heater_id": "056ee145a816487eaa69243c3280f8bf",
"item_count": 147,
"notifications": {},
"reboot": true,
"smile_name": "Adam"
}
}
11 changes: 2 additions & 9 deletions tests/components/plugwise/fixtures/m_adam_jip/all_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down Expand Up @@ -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",
Expand All @@ -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,
Expand Down Expand Up @@ -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",
Expand All @@ -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,
Expand Down Expand Up @@ -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",
Expand All @@ -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,
Expand All @@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"heater_id": "1cbf783bb11e4a7c8a6843dee3a86927",
"item_count": 66,
"notifications": {},
"reboot": true,
"smile_name": "Smile Anna"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"heater_id": "1cbf783bb11e4a7c8a6843dee3a86927",
"item_count": 66,
"notifications": {},
"reboot": true,
"smile_name": "Smile Anna"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"gateway_id": "a455b61e52394b2db5081ce025a430f3",
"item_count": 31,
"notifications": {},
"reboot": true,
"smile_name": "Smile P1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"warning": "The Smile P1 is not connected to a smart meter."
}
},
"reboot": true,
"smile_name": "Smile P1"
}
}
1 change: 1 addition & 0 deletions tests/components/plugwise/snapshots/test_diagnostics.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}),
})
Expand Down
2 changes: 1 addition & 1 deletion tests/components/plugwise/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
14 changes: 7 additions & 7 deletions tests/components/plugwise/test_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)


Expand All @@ -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
)


Expand Down Expand Up @@ -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
)

0 comments on commit f257fcb

Please sign in to comment.