diff --git a/CHANGELOG.md b/CHANGELOG.md index ecfe2c8a..2b752b06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/custom_components/plugwise_usb/__init__.py b/custom_components/plugwise_usb/__init__.py index f1acf6aa..8a35c6b5 100644 --- a/custom_components/plugwise_usb/__init__.py +++ b/custom_components/plugwise_usb/__init__.py @@ -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 diff --git a/custom_components/plugwise_usb/manifest.json b/custom_components/plugwise_usb/manifest.json index b9d2d90c..7e055277 100644 --- a/custom_components/plugwise_usb/manifest.json +++ b/custom_components/plugwise_usb/manifest.json @@ -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" } diff --git a/pyproject.toml b/pyproject.toml index 39f37a19..7ea878a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"