Skip to content

Commit d40775f

Browse files
committed
Try different code, improve debug-message
1 parent 66533da commit d40775f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

plugwise_usb/network/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,11 +516,10 @@ async def allow_join_requests(self, state: bool) -> None:
516516
_LOGGER.debug("Send AllowJoiningRequest to Circle+ with state=%s", state)
517517
request = CirclePlusAllowJoiningRequest(self._controller.send, state)
518518
if (response := await request.send()) is None:
519-
raise NodeError("No response for AllowJoiningRequest request.")
519+
raise NodeError("No response for CirclePlusAllowJoiningRequest.")
520520

521-
if (
522-
response.response_type != NodeResponseType.JOIN_ACCEPTED # state = True
523-
or response.response_type != NodeResponseType.CIRCLE_PLUS # state = False
521+
if response.response_type not in (
522+
NodeResponseType.JOIN_ACCEPTED, NodeResponseType.CIRCLE_PLUS
524523
):
525524
raise MessageError(
526525
f"Unknown NodeResponseType '{response.response_type.name}' received"

0 commit comments

Comments
 (0)