Skip to content

Commit 53a57a7

Browse files
committed
Adapt to backend changes
Link to a130
1 parent 933bfa3 commit 53a57a7

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

custom_components/plugwise_usb/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,13 @@ async def async_node_discovered(node_event: NodeEvent, mac: str) -> None:
112112
# Listen for entry updates
113113
config_entry.async_on_unload(config_entry.add_update_listener(update_listener))
114114

115-
async def device_add(call: ServiceCall) -> None:
115+
async def device_add(call: ServiceCall) -> bool:
116116
"""Manually add device to Plugwise zigbee network."""
117-
await api_stick.register_node(call.data[ATTR_MAC_ADDRESS])
117+
try:
118+
result = await api_stick.register_node(call.data[ATTR_MAC_ADDRESS])
119+
except NodeError as exc:
120+
raise HomeAssistantError(f"Failed to add device with {mac}: {exc}")
121+
return result
118122

119123
hass.services.async_register(
120124
DOMAIN, SERVICE_USB_DEVICE_ADD, device_add, SERVICE_USB_DEVICE_SCHEMA

custom_components/plugwise_usb/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"iot_class": "local_polling",
1010
"loggers": ["plugwise_usb"],
1111
"requirements": [
12-
"https://test-files.pythonhosted.org/packages/11/9e/f4d47e6e8c2d0e112a79dd5e64fe37be6a5c7aa0c8e2caeb3297a2f55c89/plugwise_usb-0.40.0a129.tar.gz#plugwise-usb==0.40.0a129"
12+
"https://test-files.pythonhosted.org/packages/8b/b2/0989d174db5cf253b5ca9f012ca82c614bbb3b041bbafadb1943a541111d/plugwise_usb-0.40.0a130.tar.gz#plugwise-usb==0.40.0a130"
1313
],
14-
"version": "0.50.0a32"
14+
"version": "0.50.0a33"
1515
}

requirements_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ pytest-asyncio
44
pytest-homeassistant-custom-component
55
aiousbwatcher
66
# From our manifest.json for our custom component
7-
plugwise_usb @ https://test-files.pythonhosted.org/packages/11/9e/f4d47e6e8c2d0e112a79dd5e64fe37be6a5c7aa0c8e2caeb3297a2f55c89/plugwise_usb-0.40.0a129.tar.gz
7+
plugwise_usb @ https://test-files.pythonhosted.org/packages/8b/b2/0989d174db5cf253b5ca9f012ca82c614bbb3b041bbafadb1943a541111d/plugwise_usb-0.40.0a130.tar.gz

0 commit comments

Comments
 (0)