Skip to content

Commit

Permalink
Reorganize context managers in send_packet
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulcahey committed Nov 13, 2022
1 parent 8d9f185 commit 8032068
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bellows/zigbee/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,10 +722,9 @@ async def send_packet(self, packet: zigpy.types.ZigbeePacket) -> None:
if not self.config[zigpy.config.CONF_SOURCE_ROUTING]:
aps_frame.options |= t.EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY

message_tag = self.get_sequence()

with self._pending.new(message_tag) as req:
async with self._limit_concurrency():
async with self._limit_concurrency():
message_tag = self.get_sequence()
with self._pending.new(message_tag) as req:
for attempt, retry_delay in enumerate(RETRY_DELAYS):
async with self._req_lock:
if packet.dst.addr_mode == zigpy.types.AddrMode.NWK:
Expand Down

0 comments on commit 8032068

Please sign in to comment.