Use builtin TimeoutError [core + helpers] (#109684)

This commit is contained in:
Marc Mueller
2024-02-05 12:09:54 +01:00
committed by GitHub
parent a9147cf3dd
commit cd0ee98dba
19 changed files with 70 additions and 74 deletions

View File

@@ -4,7 +4,6 @@ detect_location_info and elevation are mocked by default during tests.
"""
from __future__ import annotations
import asyncio
from functools import lru_cache
import math
from typing import Any, NamedTuple
@@ -165,7 +164,7 @@ async def _get_whoami(session: aiohttp.ClientSession) -> dict[str, Any] | None:
resp = await session.get(
WHOAMI_URL_DEV if HA_VERSION.endswith("0.dev0") else WHOAMI_URL, timeout=30
)
except (aiohttp.ClientError, asyncio.TimeoutError):
except (aiohttp.ClientError, TimeoutError):
return None
try: