From 5727f30026f8e64c1e688346b72b2650cef73330 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:37:26 +0200 Subject: [PATCH] Changes for aiohttp 3.10.0 (#122463) --- homeassistant/components/lifx_cloud/scene.py | 2 +- homeassistant/components/no_ip/__init__.py | 2 +- homeassistant/helpers/aiohttp_client.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/lifx_cloud/scene.py b/homeassistant/components/lifx_cloud/scene.py index 8e7ab0c2d46..b40cb081ed7 100644 --- a/homeassistant/components/lifx_cloud/scene.py +++ b/homeassistant/components/lifx_cloud/scene.py @@ -42,7 +42,7 @@ async def async_setup_platform( token = config.get(CONF_TOKEN) timeout = config.get(CONF_TIMEOUT) - headers = {AUTHORIZATION: f"Bearer {token}"} + headers: dict[str, str] = {AUTHORIZATION: f"Bearer {token}"} url = "https://api.lifx.com/v1/scenes" diff --git a/homeassistant/components/no_ip/__init__.py b/homeassistant/components/no_ip/__init__.py index 9680464c9fa..cb02490ac08 100644 --- a/homeassistant/components/no_ip/__init__.py +++ b/homeassistant/components/no_ip/__init__.py @@ -94,7 +94,7 @@ async def _update_no_ip( params = {"hostname": domain} - headers = { + headers: dict[str, str] = { AUTHORIZATION: f"Basic {auth_str.decode('utf-8')}", USER_AGENT: HA_USER_AGENT, } diff --git a/homeassistant/helpers/aiohttp_client.py b/homeassistant/helpers/aiohttp_client.py index 5c4ead4e611..245d07af5a0 100644 --- a/homeassistant/helpers/aiohttp_client.py +++ b/homeassistant/helpers/aiohttp_client.py @@ -5,6 +5,7 @@ from __future__ import annotations import asyncio from collections.abc import Awaitable, Callable from contextlib import suppress +import socket from ssl import SSLContext import sys from types import MappingProxyType @@ -300,7 +301,7 @@ def _async_get_connector( ssl_context = ssl_util.get_default_no_verify_context() connector = aiohttp.TCPConnector( - family=family, + family=socket.AddressFamily(family), enable_cleanup_closed=ENABLE_CLEANUP_CLOSED, ssl=ssl_context, limit=MAXIMUM_CONNECTIONS,