Skip to content

Commit 4162385

Browse files
committed
Allow reset requests to bypass the SREQ lock
1 parent 211b51c commit 4162385

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

zigpy_znp/api.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,15 @@ async def request(
980980
if self._uart is None:
981981
raise RuntimeError("Coordinator is disconnected, cannot send request")
982982

983+
# Immediately send reset requests
984+
ctx = (
985+
contextlib.AsyncExitStack()
986+
if isinstance(request, c.SYS.ResetReq.Req)
987+
else self._sync_request_lock
988+
)
989+
983990
# We should only be sending one SREQ at a time, according to the spec
984-
async with self._sync_request_lock:
991+
async with ctx:
985992
LOGGER.debug("Sending request: %s", request)
986993

987994
# If our request has no response, we cannot wait for one

0 commit comments

Comments
 (0)