Skip to content

Commit

Permalink
Bump plugwise to v0.18.4 (home-assistant#72263)
Browse files Browse the repository at this point in the history
  • Loading branch information
bouwew authored May 23, 2022
1 parent 800410d commit e17a653
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 36 deletions.
4 changes: 1 addition & 3 deletions homeassistant/components/plugwise/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def hvac_action(self) -> HVACAction:
return HVACAction.HEATING
if heater_central_data["binary_sensors"].get("cooling_state"):
return HVACAction.COOLING

return HVACAction.IDLE

@property
Expand Down Expand Up @@ -132,9 +133,6 @@ async def async_set_temperature(self, **kwargs: Any) -> None:
@plugwise_command
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set the hvac mode."""
if hvac_mode == HVACMode.AUTO and not self.device.get("schedule_temperature"):
raise ValueError("Cannot set HVAC mode to Auto: No schedule available")

await self.coordinator.api.set_schedule_state(
self.device["location"],
self.device.get("last_used"),
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 @@ -2,7 +2,7 @@
"domain": "plugwise",
"name": "Plugwise",
"documentation": "https://www.home-assistant.io/integrations/plugwise",
"requirements": ["plugwise==0.18.2"],
"requirements": ["plugwise==0.18.4"],
"codeowners": ["@CoMPaTech", "@bouwew", "@brefra", "@frenck"],
"zeroconf": ["_plugwise._tcp.local."],
"config_flow": true,
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ plexauth==0.0.6
plexwebsocket==0.0.13

# homeassistant.components.plugwise
plugwise==0.18.2
plugwise==0.18.4

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

# homeassistant.components.plugwise
plugwise==0.18.2
plugwise==0.18.4

# homeassistant.components.plum_lightpad
plumlightpad==0.0.11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
],
"selected_schedule": "None",
"last_used": "Badkamer Schema",
"schedule_temperature": 0.0,
"mode": "heat",
"sensors": {
"temperature": 16.5,
Expand Down Expand Up @@ -104,7 +103,6 @@
],
"selected_schedule": "GF7 Woonkamer",
"last_used": "GF7 Woonkamer",
"schedule_temperature": 15.0,
"mode": "auto",
"sensors": {
"temperature": 20.9,
Expand Down Expand Up @@ -301,7 +299,6 @@
],
"selected_schedule": "CV Jessie",
"last_used": "CV Jessie",
"schedule_temperature": 15.0,
"mode": "auto",
"sensors": {
"temperature": 17.2,
Expand Down Expand Up @@ -352,7 +349,6 @@
],
"selected_schedule": "Badkamer Schema",
"last_used": "Badkamer Schema",
"schedule_temperature": 15.0,
"mode": "auto",
"sensors": {
"temperature": 18.9,
Expand Down Expand Up @@ -402,7 +398,6 @@
],
"selected_schedule": "None",
"last_used": "Badkamer Schema",
"schedule_temperature": 0.0,
"mode": "heat",
"sensors": {
"temperature": 15.6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@
"resolution": 0.1,
"preset_modes": ["no_frost", "home", "away", "asleep", "vacation"],
"active_preset": "home",
"available_schedules": ["None"],
"selected_schedule": "None",
"last_used": null,
"schedule_temperature": null,
"mode": "heat",
"available_schedules": ["standaard"],
"selected_schedule": "standaard",
"last_used": "standaard",
"mode": "auto",
"sensors": {
"temperature": 19.3,
"setpoint": 21.0,
Expand Down
19 changes: 4 additions & 15 deletions tests/components/plugwise/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,11 @@ async def test_anna_climate_entity_attributes(
"""Test creation of anna climate device environment."""
state = hass.states.get("climate.anna")
assert state
assert state.state == HVACMode.HEAT
assert state.state == HVACMode.AUTO
assert state.attributes["hvac_modes"] == [
HVACMode.HEAT,
HVACMode.COOL,
HVACMode.AUTO,
]
assert "no_frost" in state.attributes["preset_modes"]
assert "home" in state.attributes["preset_modes"]
Expand Down Expand Up @@ -199,24 +200,12 @@ async def test_anna_climate_entity_climate_changes(
await hass.services.async_call(
"climate",
"set_hvac_mode",
{"entity_id": "climate.anna", "hvac_mode": "heat_cool"},
{"entity_id": "climate.anna", "hvac_mode": "heat"},
blocking=True,
)

assert mock_smile_anna.set_temperature.call_count == 1
assert mock_smile_anna.set_schedule_state.call_count == 1
mock_smile_anna.set_schedule_state.assert_called_with(
"c784ee9fdab44e1395b8dee7d7a497d5", None, "off"
"c784ee9fdab44e1395b8dee7d7a497d5", "standaard", "off"
)

# Auto mode is not available, no schedules
with pytest.raises(ValueError):
await hass.services.async_call(
"climate",
"set_hvac_mode",
{"entity_id": "climate.anna", "hvac_mode": "auto"},
blocking=True,
)

assert mock_smile_anna.set_temperature.call_count == 1
assert mock_smile_anna.set_schedule_state.call_count == 1
5 changes: 0 additions & 5 deletions tests/components/plugwise/test_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ async def test_diagnostics(
],
"selected_schedule": "None",
"last_used": "Badkamer Schema",
"schedule_temperature": 0.0,
"mode": "heat",
"sensors": {"temperature": 16.5, "setpoint": 13.0, "battery": 67},
},
Expand Down Expand Up @@ -120,7 +119,6 @@ async def test_diagnostics(
],
"selected_schedule": "GF7 Woonkamer",
"last_used": "GF7 Woonkamer",
"schedule_temperature": 15.0,
"mode": "auto",
"sensors": {"temperature": 20.9, "setpoint": 21.5, "battery": 34},
},
Expand Down Expand Up @@ -290,7 +288,6 @@ async def test_diagnostics(
],
"selected_schedule": "CV Jessie",
"last_used": "CV Jessie",
"schedule_temperature": 15.0,
"mode": "auto",
"sensors": {"temperature": 17.2, "setpoint": 15.0, "battery": 37},
},
Expand Down Expand Up @@ -337,7 +334,6 @@ async def test_diagnostics(
],
"selected_schedule": "Badkamer Schema",
"last_used": "Badkamer Schema",
"schedule_temperature": 15.0,
"mode": "auto",
"sensors": {"temperature": 18.9, "setpoint": 14.0, "battery": 92},
},
Expand Down Expand Up @@ -380,7 +376,6 @@ async def test_diagnostics(
],
"selected_schedule": "None",
"last_used": "Badkamer Schema",
"schedule_temperature": 0.0,
"mode": "heat",
"sensors": {
"temperature": 15.6,
Expand Down

0 comments on commit e17a653

Please sign in to comment.