Skip to content

Commit d5bdd3d

Browse files
committed
Improve set_accept_join_request()
1 parent 561737c commit d5bdd3d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plugwise_usb/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,12 @@ async def set_accept_join_request(self, state: bool) -> None:
204204
+ "without node discovery be activated. Call discover() first."
205205
)
206206

207-
if self._network.accept_join_request != state:
208-
self._network.accept_join_request = state
207+
# Observation: joining is only temporarily possible after a HA (re)start or
208+
# Integration reload, force the setting when used otherwise
209+
try:
209210
await self._network.allow_join_requests(state)
211+
except (MessageError, NodeError) as exc:
212+
raise NodeError(f"Failed setting accept joining: {exc}")
210213

211214
async def clear_cache(self) -> None:
212215
"""Clear current cache."""

0 commit comments

Comments
 (0)