Skip to content

Commit 50e4866

Browse files
committed
Limit sending allow_join_request()
1 parent f48143a commit 50e4866

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugwise_usb/network/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class StickNetwork:
4040

4141
accept_join_request = False
4242
_event_subscriptions: dict[StickEvent, int] = {}
43+
_old_acc_join_req = False
4344

4445
def __init__(
4546
self,
@@ -318,9 +319,9 @@ async def discover_network_coordinator(self, load: bool = False) -> bool:
318319
):
319320
if load:
320321
return await self._load_node(self._controller.mac_coordinator)
321-
if self.accept_join_request:
322+
if self.accept_join_request and not self._old_acc_join_req:
322323
await self.allow_join_requests(True)
323-
else:
324+
if not self.accept_join_request and self._old_acc_join_req:
324325
await self.allow_join_requests(False)
325326
return True
326327

0 commit comments

Comments
 (0)