Skip to content

Commit d824384

Browse files
authored
Merge pull request #324 from plugwise/improve_delete
Fix for #312, link to plugwise_usb v0.44.14
2 parents 6c2c799 + f172dbc commit d824384

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Versions from 0.4x
44

5+
### Ongoing
6+
7+
- Fix #312 via PR [324](https://github.com/plugwise/plugwise_usb-beta/pull/324)
8+
- Link to plugwise_usb [v0.44.14](https://github.com/plugwise/python-plugwise-usb/releases/tag/v0.44.14)
9+
510
### v0.55.10 - 2025-08-29
611

712
- Final fix for unavailable buttons via plugwise_usb [v0.44.13](https://github.com/plugwise/python-plugwise-usb/releases/tag/v0.44.13)

custom_components/plugwise_usb/__init__.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,19 +179,23 @@ async def async_remove_config_entry_device(
179179
) -> bool:
180180
"""Remove a config entry from a device."""
181181
api_stick = config_entry.runtime_data[STICK]
182-
removable = not any(
183-
identifier
184-
for identifier in device_entry.identifiers
185-
if identifier[0] == DOMAIN
186-
and identifier[1] in (str(api_stick.mac_stick), str(api_stick.mac_coordinator))
187-
)
182+
mac = None
183+
removable = False
184+
for identifier in device_entry.identifiers:
185+
if (
186+
identifier[0] == DOMAIN
187+
and identifier[1] not in (str(api_stick.mac_stick), str(api_stick.mac_coordinator))
188+
):
189+
mac = identifier[1]
190+
removable = True
191+
break
192+
188193
if removable:
189-
mac = device_entry.serial_number
190194
try:
191195
await api_stick.unregister_node(mac)
192-
except NodeError:
193-
_LOGGER.error("Plugwise device %s removal failed with NodeError", mac)
194-
return False
196+
except NodeError as exc:
197+
_LOGGER.warning("Plugwise node %s unregistering failed: %s", mac, exc)
198+
return True # Must return True for device_registry removal to happen!
195199

196200
_LOGGER.debug("Plugwise device %s successfully removed", mac)
197201
return True

custom_components/plugwise_usb/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"iot_class": "local_polling",
1010
"issue_tracker": "https://github.com/plugwise/python-plugwise-usb/issues",
1111
"loggers": ["plugwise_usb"],
12-
"requirements": ["plugwise-usb==0.44.13"],
13-
"version": "0.55.11"
12+
"requirements": ["plugwise-usb==0.44.14"],
13+
"version": "0.55.12"
1414
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "plugwise_usb-beta"
3-
version = "0.55.11"
3+
version = "0.55.12"
44
description = "Plugwise USB custom_component (BETA)"
55
readme = "README.md"
66
requires-python = ">=3.13"

0 commit comments

Comments
 (0)