Skip to content
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Versions from 0.40 and up

## v0.57.6

- Fix issue #897, partly via plugwise [v1.7.8](https://github.com/plugwise/python-plugwise/releases/tag/v1.7.8)

## v0.57.5

- Bump plugwise to [v1.7.7](https://github.com/plugwise/python-plugwise/releases/tag/v1.7.7) and adapt, small improvements
Expand Down
2 changes: 1 addition & 1 deletion custom_components/plugwise/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def hvac_modes(self) -> list[HVACMode]:
):
hvac_modes.append(HVACMode.OFF)

if AVAILABLE_SCHEDULES in self.device:
if self.device.get(AVAILABLE_SCHEDULES):
hvac_modes.append(HVACMode.AUTO)

if self.coordinator.api.cooling_present:
Expand Down
5 changes: 3 additions & 2 deletions custom_components/plugwise/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"integration_type": "hub",
"iot_class": "local_polling",
"loggers": ["plugwise"],
"requirements": ["plugwise==1.7.7"],
"version": "0.57.5",
"requirements": ["plugwise==1.7.8"
],
"version": "0.57.6",
"zeroconf": ["_plugwise._tcp.local."]
}
4 changes: 2 additions & 2 deletions custom_components/plugwise/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _add_entities() -> None:
for device_id in coordinator.new_devices:
device = coordinator.data[device_id]
for description in SELECT_TYPES:
if description.options_key in device:
if device.get(description.options_key):
entities.append(
PlugwiseSelectEntity(coordinator, device_id, description)
)
Expand Down Expand Up @@ -132,7 +132,7 @@ def __init__(
self._location = location

@property
def current_option(self) -> str:
def current_option(self) -> str| None:
"""Return the selected entity option to represent the entity state."""
return self.device[self.entity_description.key]

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "plugwise-beta"
version = "0.57.5"
version = "0.57.6"
description = "Plugwise beta custom-component"
readme = "README.md"
requires-python = ">=3.13"
Expand Down
2 changes: 2 additions & 0 deletions tests/components/plugwise/fixtures/legacy_anna/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
},
"0d266432d64443e283b5d708ae98b455": {
"active_preset": "home",
"available_schedules": [],
"climate_mode": "heat",
"control_state": "heating",
"dev_class": "thermostat",
Expand All @@ -44,6 +45,7 @@
"model": "ThermoTouch",
"name": "Anna",
"preset_modes": ["away", "vacation", "asleep", "home", "no_frost"],
"select_schedule": null,
"sensors": {
"illuminance": 150.8,
"setpoint": 20.5,
Expand Down
8 changes: 8 additions & 0 deletions tests/components/plugwise/fixtures/m_adam_jip/data.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"06aecb3d00354375924f50c47af36bd2": {
"active_preset": "no_frost",
"available_schedules": [],
"climate_mode": "off",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Slaapkamer",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"select_schedule": null,
"sensors": {
"temperature": 24.2
},
Expand All @@ -23,12 +25,14 @@
},
"13228dab8ce04617af318a2888b3c548": {
"active_preset": "home",
"available_schedules": [],
"climate_mode": "heat",
"control_state": "idle",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Woonkamer",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"select_schedule": null,
"sensors": {
"temperature": 27.4
},
Expand Down Expand Up @@ -236,12 +240,14 @@
},
"d27aede973b54be484f6842d1b2802ad": {
"active_preset": "home",
"available_schedules": [],
"climate_mode": "heat",
"control_state": "idle",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Kinderkamer",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"select_schedule": null,
"sensors": {
"temperature": 30.0
},
Expand Down Expand Up @@ -283,12 +289,14 @@
},
"d58fec52899f4f1c92e4f8fad6d8c48c": {
"active_preset": "home",
"available_schedules": [],
"climate_mode": "heat",
"control_state": "idle",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Logeerkamer",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"select_schedule": null,
"sensors": {
"temperature": 30.0
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,14 @@
},
"446ac08dd04d4eff8ac57489757b7314": {
"active_preset": "no_frost",
"available_schedules": [],
"climate_mode": "heat",
"control_state": "idle",
"dev_class": "climate",
"model": "ThermoZone",
"name": "Garage",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"select_schedule": null,
"sensors": {
"temperature": 15.6
},
Expand Down Expand Up @@ -587,7 +589,6 @@
"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."
}
},
"select_regulation_mode": "heating",
"sensors": {
"outdoor_temperature": 7.81
},
Expand Down
4 changes: 3 additions & 1 deletion tests/components/plugwise/snapshots/test_diagnostics.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@
}),
'446ac08dd04d4eff8ac57489757b7314': dict({
'active_preset': 'no_frost',
'available_schedules': list([
]),
'climate_mode': 'heat',
'control_state': 'idle',
'dev_class': 'climate',
Expand All @@ -143,6 +145,7 @@
'vacation',
'no_frost',
]),
'select_schedule': None,
'sensors': dict({
'temperature': 15.6,
}),
Expand Down Expand Up @@ -635,7 +638,6 @@
'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.",
}),
}),
'select_regulation_mode': 'heating',
'sensors': dict({
'outdoor_temperature': 7.81,
}),
Expand Down
6 changes: 4 additions & 2 deletions tests/components/plugwise/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,14 @@ async def test_anna_climate_entity_climate_changes(
)

data = mock_smile_anna.async_update.return_value
data["3cb70739631c4d17a86b8b12e8a5161b"].pop("available_schedules")
data["3cb70739631c4d17a86b8b12e8a5161b"]["available_schedules"] = []
data["3cb70739631c4d17a86b8b12e8a5161b"]["select_schedule"] = None
data["3cb70739631c4d17a86b8b12e8a5161b"]["climate_mode"] = "heat_cool"
with patch(HA_PLUGWISE_SMILE_ASYNC_UPDATE, return_value=data):
freezer.tick(timedelta(minutes=1))
async_fire_time_changed(hass)
await hass.async_block_till_done()

state = hass.states.get("climate.anna")
assert state.state == HVACMode.HEAT
assert state.state == HVACMode.HEAT_COOL
assert state.attributes["hvac_modes"] == [HVACMode.HEAT_COOL]
Loading