Skip to content

Commit 98440ea

Browse files
committed
Set output as bool and use
1 parent b3a0647 commit 98440ea

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

plugwise_usb/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,8 @@ async def plus_pair_request(self, mac: str) -> bool:
284284
"""Send a pair request to a Plus device."""
285285
if self._network is None:
286286
raise StickError("Cannot pair when network is not initialized")
287-
try:
288-
await self._network.pair_plus_device(mac)
289-
except NodeError as exc:
290-
raise NodeError(f"{exc}") from exc
291-
return True
287+
288+
return self._network.pair_plus_device(mac)
292289

293290
@raise_not_connected
294291
@raise_not_initialized

plugwise_usb/network/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def registry(self) -> list[str]:
157157

158158
# endregion
159159

160-
async def pair_plus_device(self, mac: str) -> None:
160+
async def pair_plus_device(self, mac: str) -> bool:
161161
"""Pair Plus-device to Plugwise Stick.
162162
163163
According to https://roheve.wordpress.com/author/roheve/page/2/
@@ -204,6 +204,8 @@ async def pair_plus_device(self, mac: str) -> None:
204204
if response.allowed.value != 1:
205205
raise NodeError("Pairing failed, not allowed")
206206

207+
return True
208+
207209
async def register_node(self, mac: str) -> bool:
208210
"""Register node to Plugwise network."""
209211
try:

0 commit comments

Comments
 (0)