Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump plugwise to v1.6.2 and adapt #132608

Merged
merged 6 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions homeassistant/components/plugwise/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,8 @@ def hvac_action(self) -> HVACAction:
self._previous_action_mode(self.coordinator)

# Adam provides the hvac_action for each thermostat
if self._gateway["smile_name"] == "Adam":
if (control_state := self.device.get("control_state")) == "cooling":
return HVACAction.COOLING
if control_state == "heating":
return HVACAction.HEATING
if control_state == "preheating":
return HVACAction.PREHEATING
if control_state == "off":
return HVACAction.IDLE

return HVACAction.IDLE
if (action := self.device.get("control_state")) is not None:
return HVACAction(action)

# Anna
heater: str = self._gateway["heater_id"]
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==1.6.1"],
"requirements": ["plugwise==1.6.2"],
"zeroconf": ["_plugwise._tcp.local."]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ plexauth==0.0.6
plexwebsocket==0.0.14

# homeassistant.components.plugwise
plugwise==1.6.1
plugwise==1.6.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 @@ -1332,7 +1332,7 @@ plexauth==0.0.6
plexwebsocket==0.0.14

# homeassistant.components.plugwise
plugwise==1.6.1
plugwise==1.6.2

# homeassistant.components.plum_lightpad
plumlightpad==0.0.11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
"off"
],
"climate_mode": "auto",
"control_state": "off",
"control_state": "idle",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Bathroom",
Expand Down
8 changes: 4 additions & 4 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,7 @@
"06aecb3d00354375924f50c47af36bd2": {
"active_preset": "no_frost",
"climate_mode": "off",
"control_state": "off",
"control_state": "idle",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Slaapkamer",
Expand All @@ -26,7 +26,7 @@
"13228dab8ce04617af318a2888b3c548": {
"active_preset": "home",
"climate_mode": "heat",
"control_state": "off",
"control_state": "idle",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Woonkamer",
Expand Down Expand Up @@ -238,7 +238,7 @@
"d27aede973b54be484f6842d1b2802ad": {
"active_preset": "home",
"climate_mode": "heat",
"control_state": "off",
"control_state": "idle",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Kinderkamer",
Expand Down Expand Up @@ -285,7 +285,7 @@
"d58fec52899f4f1c92e4f8fad6d8c48c": {
"active_preset": "home",
"climate_mode": "heat",
"control_state": "off",
"control_state": "idle",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Logeerkamer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"off"
],
"climate_mode": "auto",
"control_state": "idle",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Badkamer",
Expand Down Expand Up @@ -66,6 +67,7 @@
"off"
],
"climate_mode": "heat",
"control_state": "idle",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Bios",
Expand Down Expand Up @@ -112,6 +114,7 @@
"446ac08dd04d4eff8ac57489757b7314": {
"active_preset": "no_frost",
"climate_mode": "heat",
"control_state": "idle",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Garage",
Expand Down Expand Up @@ -258,6 +261,7 @@
"off"
],
"climate_mode": "auto",
"control_state": "idle",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Jessie",
Expand Down Expand Up @@ -402,6 +406,7 @@
"off"
],
"climate_mode": "auto",
"control_state": "heating",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Woonkamer",
Expand Down Expand Up @@ -577,7 +582,7 @@
"cooling_present": false,
"gateway_id": "fe799307f1624099878210aa0b9f1475",
"heater_id": "90986d591dcd426cae3ec3e8111ff730",
"item_count": 364,
"item_count": 369,
"notifications": {
"af82e4ccf9c548528166d38e560662a4": {
"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."
Expand Down
7 changes: 6 additions & 1 deletion tests/components/plugwise/snapshots/test_diagnostics.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'off',
]),
'climate_mode': 'auto',
'control_state': 'idle',
'dev_class': 'climate',
'model': 'ThermoZone',
'name': 'Badkamer',
Expand Down Expand Up @@ -75,6 +76,7 @@
'off',
]),
'climate_mode': 'heat',
'control_state': 'idle',
'dev_class': 'climate',
'model': 'ThermoZone',
'name': 'Bios',
Expand Down Expand Up @@ -131,6 +133,7 @@
'446ac08dd04d4eff8ac57489757b7314': dict({
'active_preset': 'no_frost',
'climate_mode': 'heat',
'control_state': 'idle',
'dev_class': 'climate',
'model': 'ThermoZone',
'name': 'Garage',
Expand Down Expand Up @@ -286,6 +289,7 @@
'off',
]),
'climate_mode': 'auto',
'control_state': 'idle',
'dev_class': 'climate',
'model': 'ThermoZone',
'name': 'Jessie',
Expand Down Expand Up @@ -440,6 +444,7 @@
'off',
]),
'climate_mode': 'auto',
'control_state': 'heating',
'dev_class': 'climate',
'model': 'ThermoZone',
'name': 'Woonkamer',
Expand Down Expand Up @@ -625,7 +630,7 @@
'cooling_present': False,
'gateway_id': 'fe799307f1624099878210aa0b9f1475',
'heater_id': '90986d591dcd426cae3ec3e8111ff730',
'item_count': 364,
'item_count': 369,
'notifications': dict({
'af82e4ccf9c548528166d38e560662a4': dict({
'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.",
Expand Down
12 changes: 4 additions & 8 deletions tests/components/plugwise/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ async def test_adam_climate_entity_attributes(
state = hass.states.get("climate.woonkamer")
assert state
assert state.state == HVACMode.AUTO
assert state.attributes["hvac_action"] == "heating"
assert state.attributes["hvac_modes"] == [HVACMode.AUTO, HVACMode.HEAT]
# hvac_action is not asserted as the fixture is not in line with recent firmware functionality

assert "preset_modes" in state.attributes
assert "no_frost" in state.attributes["preset_modes"]
assert "home" in state.attributes["preset_modes"]

assert state.attributes["current_temperature"] == 20.9
assert state.attributes["preset_mode"] == "home"
assert state.attributes["current_temperature"] == 20.9
assert state.attributes["supported_features"] == 17
assert state.attributes["temperature"] == 21.5
assert state.attributes["min_temp"] == 0.0
Expand All @@ -49,15 +47,13 @@ async def test_adam_climate_entity_attributes(
state = hass.states.get("climate.jessie")
assert state
assert state.state == HVACMode.AUTO
assert state.attributes["hvac_action"] == "idle"
assert state.attributes["hvac_modes"] == [HVACMode.AUTO, HVACMode.HEAT]
# hvac_action is not asserted as the fixture is not in line with recent firmware functionality

assert "preset_modes" in state.attributes
assert "no_frost" in state.attributes["preset_modes"]
assert "home" in state.attributes["preset_modes"]

assert state.attributes["current_temperature"] == 17.2
assert state.attributes["preset_mode"] == "asleep"
assert state.attributes["current_temperature"] == 17.2
assert state.attributes["temperature"] == 15.0
assert state.attributes["min_temp"] == 0.0
assert state.attributes["max_temp"] == 35.0
Expand Down
Loading