Skip to content
Merged
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Versions from 0.4x

### Ongoing

- Fix #312 via PR [324](https://github.com/plugwise/plugwise_usb-beta/pull/324)
- Link to plugwise_usb [v0.44.14](https://github.com/plugwise/python-plugwise-usb/releases/tag/v0.44.14)

### v0.55.10 - 2025-08-29

- Final fix for unavailable buttons via plugwise_usb [v0.44.13](https://github.com/plugwise/python-plugwise-usb/releases/tag/v0.44.13)
Expand Down
24 changes: 14 additions & 10 deletions custom_components/plugwise_usb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,23 @@ async def async_remove_config_entry_device(
) -> bool:
"""Remove a config entry from a device."""
api_stick = config_entry.runtime_data[STICK]
removable = not any(
identifier
for identifier in device_entry.identifiers
if identifier[0] == DOMAIN
and identifier[1] in (str(api_stick.mac_stick), str(api_stick.mac_coordinator))
)
mac = None
removable = False
for identifier in device_entry.identifiers:
if (
identifier[0] == DOMAIN
and identifier[1] not in (str(api_stick.mac_stick), str(api_stick.mac_coordinator))
):
mac = identifier[1]
removable = True
break

if removable:
mac = device_entry.serial_number
try:
await api_stick.unregister_node(mac)
except NodeError:
_LOGGER.error("Plugwise device %s removal failed with NodeError", mac)
return False
except NodeError as exc:
_LOGGER.warning("Plugwise node %s unregistering failed: %s", mac, exc)
return True # Must return True for device_registry removal to happen!

_LOGGER.debug("Plugwise device %s successfully removed", mac)
return True
Expand Down
4 changes: 2 additions & 2 deletions custom_components/plugwise_usb/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/plugwise/python-plugwise-usb/issues",
"loggers": ["plugwise_usb"],
"requirements": ["plugwise-usb==0.44.13"],
"version": "0.55.11"
"requirements": ["plugwise-usb==0.44.14"],
"version": "0.55.12"
}
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_usb-beta"
version = "0.55.11"
version = "0.55.12"
description = "Plugwise USB custom_component (BETA)"
readme = "README.md"
requires-python = ">=3.13"
Expand Down
Loading