Skip to content

Commit

Permalink
fix use of asyncio_timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
tl-sl committed Nov 24, 2024
1 parent b90ca2b commit db21b70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion universal_silabs_flasher/flasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ async def enter_bootloader(self) -> None:
await spinel.enter_bootloader()
elif self.app_type is ApplicationType.ROUTER:
async with self._connect_router(self.app_baudrate) as router:
async with async_timeout.timeout(PROBE_TIMEOUT):
async with asyncio_timeout(PROBE_TIMEOUT):
await router.enter_bootloader()
elif self.app_type is ApplicationType.EZSP:
async with self._connect_ezsp(self.app_baudrate) as ezsp:
Expand Down
5 changes: 2 additions & 3 deletions universal_silabs_flasher/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import logging
import re

import async_timeout
from zigpy.serial import SerialProtocol

from .common import PROBE_TIMEOUT, StateMachine, Version
from .common import PROBE_TIMEOUT, StateMachine, Version, asyncio_timeout

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -38,7 +37,7 @@ def __init__(self) -> None:

async def probe(self) -> Version:
"""Attempt to communicate with the router."""
async with async_timeout.timeout(PROBE_TIMEOUT):
async with asyncio_timeout(PROBE_TIMEOUT):
return await self.router_info()

async def router_info(self) -> Version:
Expand Down

0 comments on commit db21b70

Please sign in to comment.