Skip to content
Merged
Changes from 1 commit
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
17 changes: 13 additions & 4 deletions zigpy_znp/zigbee/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,8 +891,9 @@ async def send_packet(self, packet: zigpy.types.ZigbeePacket) -> None:
try:
# We retry sending twice but the only devices that will use the second retry
# attempt are sleeping end devices that silently switched parents from the
# coordinator, all others will fail immediately
for _retry_attempt in range(2):
# coordinator, as well as devices for which we just rediscovered a route.
# All others will fail immediately.
for retry_attempt in range(2):
async with self._limit_concurrency(priority=packet.priority):
try:
# ZDO requests do not generate `AF.DataConfirm` messages
Expand Down Expand Up @@ -973,9 +974,17 @@ async def send_packet(self, packet: zigpy.types.ZigbeePacket) -> None:
else:
continue

# Perform route discovery explicitly if the stack fails
if e.response.Status == t.Status.NWK_NO_ROUTE:
# Perform route discovery explicitly if the stack fails and
# then retry the request. zigpy no longer retries failed
# requests at the application level (zigpy #1824), so the retry
# must happen here for route rediscovery to take effect.
if (
e.response.Status == t.Status.NWK_NO_ROUTE
and device is not None
and retry_attempt < 1
):
await self._discover_route(device.nwk)
continue
Comment thread
TheJulianJES marked this conversation as resolved.

raise
except InvalidCommandResponse as e:
Expand Down
Loading