Skip to content

Commit a0400e4

Browse files
committed
Call allow_join_request() via accept_join_request setter
1 parent bc1c9dd commit a0400e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugwise_usb/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,19 +191,22 @@ def accept_join_request(self) -> bool | None:
191191
return self._network.accept_join_request
192192

193193
@accept_join_request.setter
194-
def accept_join_request(self, state: bool) -> None:
194+
async def accept_join_request(self, state: bool) -> None:
195195
"""Configure join request setting."""
196196
if not self._controller.is_connected:
197197
raise StickError(
198198
"Cannot accept joining node"
199199
+ " without an active USB-Stick connection."
200200
)
201+
201202
if self._network is None or not self._network.is_running:
202203
raise StickError(
203204
"Cannot accept joining node"
204205
+ "without node discovery be activated. Call discover() first."
205206
)
207+
206208
self._network.accept_join_request = state
209+
await self._network.allow_join_requests(state)
207210

208211
async def clear_cache(self) -> None:
209212
"""Clear current cache."""

0 commit comments

Comments
 (0)