Skip to content

Commit

Permalink
Bump plugwise to v0.32.2 (#99973)
Browse files Browse the repository at this point in the history
* Bump plugwise to v0.32.2

* Adapt number.py to the backend updates

* Update related test-cases

* Update plugwise test-fixtures

* Update test_diagnostics.py
  • Loading branch information
bouwew authored Sep 9, 2023
1 parent af8fd6c commit 081d0bd
Show file tree
Hide file tree
Showing 16 changed files with 470 additions and 268 deletions.
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": ["crcmod", "plugwise"],
"requirements": ["plugwise==0.31.9"],
"requirements": ["plugwise==0.32.2"],
"zeroconf": ["_plugwise._tcp.local."]
}
13 changes: 9 additions & 4 deletions homeassistant/components/plugwise/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
class PlugwiseEntityDescriptionMixin:
"""Mixin values for Plugwise entities."""

command: Callable[[Smile, str, float], Awaitable[None]]
command: Callable[[Smile, str, str, float], Awaitable[None]]


@dataclass
Expand All @@ -43,15 +43,19 @@ class PlugwiseNumberEntityDescription(
PlugwiseNumberEntityDescription(
key="maximum_boiler_temperature",
translation_key="maximum_boiler_temperature",
command=lambda api, number, value: api.set_number_setpoint(number, value),
command=lambda api, number, dev_id, value: api.set_number_setpoint(
number, dev_id, value
),
device_class=NumberDeviceClass.TEMPERATURE,
entity_category=EntityCategory.CONFIG,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
),
PlugwiseNumberEntityDescription(
key="max_dhw_temperature",
translation_key="max_dhw_temperature",
command=lambda api, number, value: api.set_number_setpoint(number, value),
command=lambda api, number, dev_id, value: api.set_number_setpoint(
number, dev_id, value
),
device_class=NumberDeviceClass.TEMPERATURE,
entity_category=EntityCategory.CONFIG,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
Expand Down Expand Up @@ -94,6 +98,7 @@ def __init__(
) -> None:
"""Initiate Plugwise Number."""
super().__init__(coordinator, device_id)
self.device_id = device_id
self.entity_description = description
self._attr_unique_id = f"{device_id}-{description.key}"
self._attr_mode = NumberMode.BOX
Expand All @@ -109,6 +114,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, value
self.coordinator.api, self.entity_description.key, self.device_id, 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 @@ -1439,7 +1439,7 @@ plexauth==0.0.6
plexwebsocket==0.0.13

# homeassistant.components.plugwise
plugwise==0.31.9
plugwise==0.32.2

# 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 @@ -1093,7 +1093,7 @@ plexauth==0.0.6
plexwebsocket==0.0.13

# homeassistant.components.plugwise
plugwise==0.31.9
plugwise==0.32.2

# homeassistant.components.plum_lightpad
plumlightpad==0.0.11
Expand Down
48 changes: 48 additions & 0 deletions tests/components/plugwise/fixtures/adam_jip/all_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
"setpoint": 13.0,
"temperature": 24.2
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 0.0,
"resolution": 0.01,
Expand All @@ -43,6 +49,12 @@
"temperature_difference": 2.0,
"valve_position": 0.0
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.1,
"upper_bound": 2.0
},
"vendor": "Plugwise",
"zigbee_mac_address": "ABCD012345670A07"
},
Expand All @@ -60,6 +72,12 @@
"temperature_difference": 1.7,
"valve_position": 0.0
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.1,
"upper_bound": 2.0
},
"vendor": "Plugwise",
"zigbee_mac_address": "ABCD012345670A05"
},
Expand Down Expand Up @@ -99,6 +117,12 @@
"setpoint": 13.0,
"temperature": 30.0
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 0.0,
"resolution": 0.01,
Expand All @@ -122,6 +146,12 @@
"temperature_difference": 1.8,
"valve_position": 100
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.1,
"upper_bound": 2.0
},
"vendor": "Plugwise",
"zigbee_mac_address": "ABCD012345670A09"
},
Expand All @@ -145,6 +175,12 @@
"setpoint": 13.0,
"temperature": 30.0
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 0.0,
"resolution": 0.01,
Expand Down Expand Up @@ -187,6 +223,12 @@
"temperature_difference": 1.9,
"valve_position": 0.0
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.1,
"upper_bound": 2.0
},
"vendor": "Plugwise",
"zigbee_mac_address": "ABCD012345670A04"
},
Expand Down Expand Up @@ -246,6 +288,12 @@
"setpoint": 9.0,
"temperature": 27.4
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 4.0,
"resolution": 0.01,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@
"temperature_difference": -0.4,
"valve_position": 0.0
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"vendor": "Plugwise",
"zigbee_mac_address": "ABCD012345670A17"
},
Expand Down Expand Up @@ -123,6 +129,12 @@
"setpoint": 15.0,
"temperature": 17.2
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 0.0,
"resolution": 0.01,
Expand Down Expand Up @@ -200,6 +212,12 @@
"temperature_difference": -0.2,
"valve_position": 0.0
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"vendor": "Plugwise",
"zigbee_mac_address": "ABCD012345670A09"
},
Expand All @@ -217,6 +235,12 @@
"temperature_difference": 3.5,
"valve_position": 100
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"vendor": "Plugwise",
"zigbee_mac_address": "ABCD012345670A02"
},
Expand Down Expand Up @@ -245,6 +269,12 @@
"setpoint": 21.5,
"temperature": 20.9
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 0.0,
"resolution": 0.01,
Expand Down Expand Up @@ -289,6 +319,12 @@
"temperature_difference": 0.1,
"valve_position": 0.0
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"vendor": "Plugwise",
"zigbee_mac_address": "ABCD012345670A10"
},
Expand Down Expand Up @@ -317,6 +353,12 @@
"setpoint": 13.0,
"temperature": 16.5
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 0.0,
"resolution": 0.01,
Expand Down Expand Up @@ -353,6 +395,12 @@
"temperature_difference": 0.0,
"valve_position": 0.0
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 0.0,
"resolution": 0.01,
Expand Down Expand Up @@ -387,6 +435,12 @@
"setpoint": 14.0,
"temperature": 18.9
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 0.0,
"resolution": 0.01,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
"setpoint": 20.5,
"temperature": 19.3
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": -0.5,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 4.0,
"resolution": 0.1,
Expand Down
12 changes: 12 additions & 0 deletions tests/components/plugwise/fixtures/m_adam_cooling/all_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
"temperature_difference": 2.3,
"valve_position": 0.0
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.1,
"upper_bound": 2.0
},
"vendor": "Plugwise",
"zigbee_mac_address": "ABCD012345670A01"
},
Expand Down Expand Up @@ -118,6 +124,12 @@
"setpoint_low": 20.0,
"temperature": 239
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 0.0,
"resolution": 0.01,
Expand Down
12 changes: 12 additions & 0 deletions tests/components/plugwise/fixtures/m_adam_heating/all_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
"temperature_difference": 2.3,
"valve_position": 0.0
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.1,
"upper_bound": 2.0
},
"vendor": "Plugwise",
"zigbee_mac_address": "ABCD012345670A01"
},
Expand Down Expand Up @@ -114,6 +120,12 @@
"setpoint": 15.0,
"temperature": 17.9
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 0.0,
"resolution": 0.01,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
"setpoint_low": 20.5,
"temperature": 26.3
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": -0.5,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 4.0,
"resolution": 0.1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
"setpoint_low": 20.5,
"temperature": 23.0
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": -0.5,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 4.0,
"resolution": 0.1,
Expand Down
Loading

0 comments on commit 081d0bd

Please sign in to comment.