mirror of
https://github.com/home-assistant/core.git
synced 2025-11-11 20:10:12 +00:00
Use aiohttp.ClientTimeout for timeout (#122458)
This commit is contained in:
@@ -163,7 +163,8 @@ async def _get_whoami(session: aiohttp.ClientSession) -> dict[str, Any] | None:
|
||||
"""Query whoami.home-assistant.io for location data."""
|
||||
try:
|
||||
resp = await session.get(
|
||||
WHOAMI_URL_DEV if HA_VERSION.endswith("0.dev0") else WHOAMI_URL, timeout=30
|
||||
WHOAMI_URL_DEV if HA_VERSION.endswith("0.dev0") else WHOAMI_URL,
|
||||
timeout=aiohttp.ClientTimeout(total=30),
|
||||
)
|
||||
except (aiohttp.ClientError, TimeoutError):
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user