From aae34414174ea01023b35308b12e1be494a4f01b Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 20 Nov 2023 20:56:54 +0100 Subject: [PATCH] Replace async_timeout with asyncio.timeout --- src/wled/wled.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/wled/wled.py b/src/wled/wled.py index f12dcbe2..6d0d7a68 100644 --- a/src/wled/wled.py +++ b/src/wled/wled.py @@ -9,7 +9,6 @@ from typing import TYPE_CHECKING, Any, Self import aiohttp -import async_timeout import backoff from awesomeversion import AwesomeVersion, AwesomeVersionException from cachetools import TTLCache @@ -184,7 +183,7 @@ async def request( data["v"] = True try: - async with async_timeout.timeout(self.request_timeout): + async with asyncio.timeout(self.request_timeout): response = await self.session.request( method, url, @@ -689,7 +688,7 @@ async def upgrade(self, *, version: str | AwesomeVersion) -> None: ) try: - async with async_timeout.timeout( + async with asyncio.timeout( self.request_timeout * 10, ), self.session.get( download_url, @@ -744,7 +743,7 @@ async def get_wled_versions_from_github(self) -> dict[str, str | None]: return {"version_latest_stable": None, "version_latest_beta": None} try: - async with async_timeout.timeout(self.request_timeout): + async with asyncio.timeout(self.request_timeout): response = await self.session.get( "https://api.github.com/repos/Aircoookie/WLED/releases", headers={"Accept": "application/json"},