Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions zigpy_deconz/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,16 +572,15 @@ async def _command(self, cmd, **kwargs):

async with self._command_lock(priority=self._get_command_priority(command)):
seq = self._seq

LOGGER.debug("Sending %s%s (seq=%s)", cmd, kwargs, seq)
self._uart.send(command.replace(seq=seq).serialize())

self._seq = (self._seq % 255) + 1

fut = asyncio.Future()
self._awaiting[seq][cmd].append(fut)

try:
LOGGER.debug("Sending %s%s (seq=%s)", cmd, kwargs, seq)
self._uart.send(command.replace(seq=seq).serialize())

async with asyncio_timeout(COMMAND_TIMEOUT):
return await fut
except asyncio.TimeoutError:
Expand Down