diff --git a/homeassistant/components/amcrest/__init__.py b/homeassistant/components/amcrest/__init__.py index 26247816ac90..bb8956f8b15c 100644 --- a/homeassistant/components/amcrest/__init__.py +++ b/homeassistant/components/amcrest/__init__.py @@ -1,12 +1,13 @@ """Support for Amcrest IP cameras.""" from __future__ import annotations +from collections.abc import Callable from contextlib import suppress from dataclasses import dataclass from datetime import datetime, timedelta import logging import threading -from typing import Any, Callable +from typing import Any import aiohttp from amcrest import AmcrestError, ApiWrapper, LoginError diff --git a/homeassistant/components/amcrest/binary_sensor.py b/homeassistant/components/amcrest/binary_sensor.py index 48bc6727585a..ea8f15d838c8 100644 --- a/homeassistant/components/amcrest/binary_sensor.py +++ b/homeassistant/components/amcrest/binary_sensor.py @@ -1,11 +1,12 @@ """Support for Amcrest IP camera binary sensors.""" from __future__ import annotations +from collections.abc import Callable from contextlib import suppress from dataclasses import dataclass from datetime import timedelta import logging -from typing import TYPE_CHECKING, Callable +from typing import TYPE_CHECKING from amcrest import AmcrestError import voluptuous as vol diff --git a/homeassistant/components/amcrest/camera.py b/homeassistant/components/amcrest/camera.py index f118bd0da775..3c91607f96d1 100644 --- a/homeassistant/components/amcrest/camera.py +++ b/homeassistant/components/amcrest/camera.py @@ -2,10 +2,11 @@ from __future__ import annotations import asyncio +from collections.abc import Callable from datetime import timedelta from functools import partial import logging -from typing import TYPE_CHECKING, Any, Callable +from typing import TYPE_CHECKING, Any from aiohttp import web from amcrest import AmcrestError diff --git a/homeassistant/components/amcrest/sensor.py b/homeassistant/components/amcrest/sensor.py index 87bb1d5c758f..752aabc2c92a 100644 --- a/homeassistant/components/amcrest/sensor.py +++ b/homeassistant/components/amcrest/sensor.py @@ -1,9 +1,10 @@ """Support for Amcrest IP camera sensors.""" from __future__ import annotations +from collections.abc import Callable from datetime import timedelta import logging -from typing import TYPE_CHECKING, Callable +from typing import TYPE_CHECKING from amcrest import AmcrestError diff --git a/homeassistant/components/azure_event_hub/__init__.py b/homeassistant/components/azure_event_hub/__init__.py index 9bae21ec43be..039542f9ed62 100644 --- a/homeassistant/components/azure_event_hub/__init__.py +++ b/homeassistant/components/azure_event_hub/__init__.py @@ -2,10 +2,11 @@ from __future__ import annotations import asyncio +from collections.abc import Callable import json import logging import time -from typing import Any, Callable +from typing import Any from azure.eventhub import EventData, EventDataBatch from azure.eventhub.aio import EventHubProducerClient, EventHubSharedKeyCredential diff --git a/homeassistant/components/camera/__init__.py b/homeassistant/components/camera/__init__.py index 040a49dcc4af..bfa68fe67e6f 100644 --- a/homeassistant/components/camera/__init__.py +++ b/homeassistant/components/camera/__init__.py @@ -4,7 +4,7 @@ from __future__ import annotations import asyncio import base64 import collections -from collections.abc import Awaitable, Mapping +from collections.abc import Awaitable, Callable, Mapping from contextlib import suppress from dataclasses import dataclass from datetime import datetime, timedelta @@ -14,7 +14,7 @@ import inspect import logging import os from random import SystemRandom -from typing import Callable, Final, cast, final +from typing import Final, cast, final from aiohttp import web import async_timeout diff --git a/homeassistant/components/climacell/const.py b/homeassistant/components/climacell/const.py index 162fbb015452..3b5bc360d7c1 100644 --- a/homeassistant/components/climacell/const.py +++ b/homeassistant/components/climacell/const.py @@ -1,9 +1,9 @@ """Constants for the ClimaCell integration.""" from __future__ import annotations +from collections.abc import Callable from dataclasses import dataclass from enum import IntEnum -from typing import Callable from pyclimacell.const import ( DAILY, diff --git a/homeassistant/components/deconz/logbook.py b/homeassistant/components/deconz/logbook.py index 16497d00ccbd..0d7ad67dda6f 100644 --- a/homeassistant/components/deconz/logbook.py +++ b/homeassistant/components/deconz/logbook.py @@ -1,7 +1,7 @@ """Describe deCONZ logbook events.""" from __future__ import annotations -from typing import Callable +from collections.abc import Callable from homeassistant.const import ATTR_DEVICE_ID, CONF_EVENT from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/dsmr_reader/definitions.py b/homeassistant/components/dsmr_reader/definitions.py index 1e9834e7e5ec..1c719bc890b3 100644 --- a/homeassistant/components/dsmr_reader/definitions.py +++ b/homeassistant/components/dsmr_reader/definitions.py @@ -1,8 +1,9 @@ """Definitions for DSMR Reader sensors added to MQTT.""" from __future__ import annotations +from collections.abc import Callable from dataclasses import dataclass -from typing import Callable, Final +from typing import Final from homeassistant.components.sensor import ( STATE_CLASS_MEASUREMENT, diff --git a/homeassistant/components/firmata/pin.py b/homeassistant/components/firmata/pin.py index af07871efc7b..6dadb07fd631 100644 --- a/homeassistant/components/firmata/pin.py +++ b/homeassistant/components/firmata/pin.py @@ -1,6 +1,8 @@ """Code to handle pins on a Firmata board.""" +from __future__ import annotations + +from collections.abc import Callable import logging -from typing import Callable from .board import FirmataBoard, FirmataPinType from .const import PIN_MODE_INPUT, PIN_MODE_PULLUP, PIN_TYPE_ANALOG diff --git a/homeassistant/components/fritzbox/binary_sensor.py b/homeassistant/components/fritzbox/binary_sensor.py index 25831da957cf..1317710c5707 100644 --- a/homeassistant/components/fritzbox/binary_sensor.py +++ b/homeassistant/components/fritzbox/binary_sensor.py @@ -1,8 +1,9 @@ """Support for Fritzbox binary sensors.""" from __future__ import annotations +from collections.abc import Callable from dataclasses import dataclass -from typing import Callable, Final +from typing import Final from pyfritzhome.fritzhomedevice import FritzhomeDevice diff --git a/homeassistant/components/fritzbox/model.py b/homeassistant/components/fritzbox/model.py index baa8f656c024..fa6da56caebe 100644 --- a/homeassistant/components/fritzbox/model.py +++ b/homeassistant/components/fritzbox/model.py @@ -1,8 +1,9 @@ """Models for the AVM FRITZ!SmartHome integration.""" from __future__ import annotations +from collections.abc import Callable from dataclasses import dataclass -from typing import Callable, TypedDict +from typing import TypedDict from pyfritzhome import FritzhomeDevice diff --git a/homeassistant/components/fritzbox/sensor.py b/homeassistant/components/fritzbox/sensor.py index 6f1cf49129da..7ff66f193c9c 100644 --- a/homeassistant/components/fritzbox/sensor.py +++ b/homeassistant/components/fritzbox/sensor.py @@ -1,8 +1,9 @@ """Support for AVM FRITZ!SmartHome temperature sensor only devices.""" from __future__ import annotations +from collections.abc import Callable from dataclasses import dataclass -from typing import Callable, Final +from typing import Final from pyfritzhome.fritzhomedevice import FritzhomeDevice diff --git a/homeassistant/components/frontend/storage.py b/homeassistant/components/frontend/storage.py index 294b707c9651..0b04655bd86d 100644 --- a/homeassistant/components/frontend/storage.py +++ b/homeassistant/components/frontend/storage.py @@ -1,8 +1,9 @@ """API for persistent storage for the frontend.""" from __future__ import annotations +from collections.abc import Callable from functools import wraps -from typing import Any, Callable +from typing import Any import voluptuous as vol diff --git a/homeassistant/components/homematicip_cloud/hap.py b/homeassistant/components/homematicip_cloud/hap.py index 3f8f6ae60860..a3537bff31b0 100644 --- a/homeassistant/components/homematicip_cloud/hap.py +++ b/homeassistant/components/homematicip_cloud/hap.py @@ -2,8 +2,9 @@ from __future__ import annotations import asyncio +from collections.abc import Callable import logging -from typing import Any, Callable +from typing import Any from homematicip.aio.auth import AsyncAuth from homematicip.aio.home import AsyncHome diff --git a/homeassistant/components/http/data_validator.py b/homeassistant/components/http/data_validator.py index f64a3c4830eb..cc661d43fd84 100644 --- a/homeassistant/components/http/data_validator.py +++ b/homeassistant/components/http/data_validator.py @@ -1,11 +1,11 @@ """Decorator for view methods to help with data validation.""" from __future__ import annotations -from collections.abc import Awaitable +from collections.abc import Awaitable, Callable from functools import wraps from http import HTTPStatus import logging -from typing import Any, Callable +from typing import Any from aiohttp import web import voluptuous as vol diff --git a/homeassistant/components/huawei_lte/__init__.py b/homeassistant/components/huawei_lte/__init__.py index ec9281659f5d..92122f1b2be0 100644 --- a/homeassistant/components/huawei_lte/__init__.py +++ b/homeassistant/components/huawei_lte/__init__.py @@ -2,11 +2,12 @@ from __future__ import annotations from collections import defaultdict +from collections.abc import Callable from contextlib import suppress from datetime import timedelta import logging import time -from typing import Any, Callable, cast +from typing import Any, cast import attr from huawei_lte_api.AuthorizedConnection import AuthorizedConnection diff --git a/homeassistant/components/huawei_lte/sensor.py b/homeassistant/components/huawei_lte/sensor.py index 746e44687ca2..f62450088aee 100644 --- a/homeassistant/components/huawei_lte/sensor.py +++ b/homeassistant/components/huawei_lte/sensor.py @@ -2,9 +2,10 @@ from __future__ import annotations from bisect import bisect +from collections.abc import Callable import logging import re -from typing import Callable, NamedTuple +from typing import NamedTuple import attr diff --git a/homeassistant/components/influxdb/__init__.py b/homeassistant/components/influxdb/__init__.py index bb5cf0173c10..407036e327c0 100644 --- a/homeassistant/components/influxdb/__init__.py +++ b/homeassistant/components/influxdb/__init__.py @@ -1,6 +1,7 @@ """Support for sending data to an Influx database.""" from __future__ import annotations +from collections.abc import Callable from contextlib import suppress from dataclasses import dataclass import logging @@ -8,7 +9,7 @@ import math import queue import threading import time -from typing import Any, Callable +from typing import Any from influxdb import InfluxDBClient, exceptions from influxdb_client import InfluxDBClient as InfluxDBClientV2 diff --git a/homeassistant/components/keenetic_ndms2/router.py b/homeassistant/components/keenetic_ndms2/router.py index d79f25915251..8da8034a162a 100644 --- a/homeassistant/components/keenetic_ndms2/router.py +++ b/homeassistant/components/keenetic_ndms2/router.py @@ -1,9 +1,9 @@ """The Keenetic Client class.""" from __future__ import annotations +from collections.abc import Callable from datetime import timedelta import logging -from typing import Callable from ndms2_client import Client, ConnectionException, Device, TelnetConnection from ndms2_client.client import RouterInfo diff --git a/homeassistant/components/mobile_app/helpers.py b/homeassistant/components/mobile_app/helpers.py index 9902e1d93d70..2325a75e6309 100644 --- a/homeassistant/components/mobile_app/helpers.py +++ b/homeassistant/components/mobile_app/helpers.py @@ -1,9 +1,9 @@ """Helpers for mobile_app.""" from __future__ import annotations +from collections.abc import Callable import json import logging -from typing import Callable from aiohttp.web import Response, json_response from nacl.encoding import Base64Encoder diff --git a/homeassistant/components/mobile_app/push_notification.py b/homeassistant/components/mobile_app/push_notification.py index 1cc5bac5d1cf..f3852895d32a 100644 --- a/homeassistant/components/mobile_app/push_notification.py +++ b/homeassistant/components/mobile_app/push_notification.py @@ -1,6 +1,8 @@ """Push notification handling.""" +from __future__ import annotations + import asyncio -from typing import Callable +from collections.abc import Callable from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.event import async_call_later diff --git a/homeassistant/components/motioneye/__init__.py b/homeassistant/components/motioneye/__init__.py index 3eebcd4ee532..07385f242163 100644 --- a/homeassistant/components/motioneye/__init__.py +++ b/homeassistant/components/motioneye/__init__.py @@ -2,10 +2,11 @@ from __future__ import annotations import asyncio +from collections.abc import Callable import json import logging from types import MappingProxyType -from typing import Any, Callable +from typing import Any from urllib.parse import urlencode, urljoin from aiohttp.web import Request, Response diff --git a/homeassistant/components/mysensors/__init__.py b/homeassistant/components/mysensors/__init__.py index 3d0f219c2a81..b6ad78f5dc8e 100644 --- a/homeassistant/components/mysensors/__init__.py +++ b/homeassistant/components/mysensors/__init__.py @@ -2,9 +2,9 @@ from __future__ import annotations import asyncio +from collections.abc import Callable from functools import partial import logging -from typing import Callable from mysensors import BaseAsyncGateway import voluptuous as vol diff --git a/homeassistant/components/mysensors/device_tracker.py b/homeassistant/components/mysensors/device_tracker.py index 544fb8d6b090..1dd29dbf864f 100644 --- a/homeassistant/components/mysensors/device_tracker.py +++ b/homeassistant/components/mysensors/device_tracker.py @@ -1,7 +1,8 @@ """Support for tracking MySensors devices.""" from __future__ import annotations -from typing import Any, Callable +from collections.abc import Callable +from typing import Any from homeassistant.components import mysensors from homeassistant.components.device_tracker import DOMAIN diff --git a/homeassistant/components/mysensors/gateway.py b/homeassistant/components/mysensors/gateway.py index f9410f66e8f2..1f9b96e6825a 100644 --- a/homeassistant/components/mysensors/gateway.py +++ b/homeassistant/components/mysensors/gateway.py @@ -3,11 +3,11 @@ from __future__ import annotations import asyncio from collections import defaultdict -from collections.abc import Coroutine +from collections.abc import Callable, Coroutine import logging import socket import sys -from typing import Any, Callable +from typing import Any import async_timeout from mysensors import BaseAsyncGateway, Message, Sensor, mysensors diff --git a/homeassistant/components/mysensors/helpers.py b/homeassistant/components/mysensors/helpers.py index 7c50526cd6e1..eba382fb52dd 100644 --- a/homeassistant/components/mysensors/helpers.py +++ b/homeassistant/components/mysensors/helpers.py @@ -2,9 +2,9 @@ from __future__ import annotations from collections import defaultdict +from collections.abc import Callable from enum import IntEnum import logging -from typing import Callable from mysensors import BaseAsyncGateway, Message from mysensors.sensor import ChildSensor diff --git a/homeassistant/components/netgear/router.py b/homeassistant/components/netgear/router.py index a500bffb9661..83b1aaa9f328 100644 --- a/homeassistant/components/netgear/router.py +++ b/homeassistant/components/netgear/router.py @@ -1,8 +1,10 @@ """Represent the Netgear router and its devices.""" +from __future__ import annotations + from abc import abstractmethod +from collections.abc import Callable from datetime import timedelta import logging -from typing import Callable from pynetgear import Netgear @@ -62,7 +64,7 @@ def async_setup_netgear_entry( hass: HomeAssistantType, entry: ConfigEntry, async_add_entities: AddEntitiesCallback, - entity_class_generator: Callable[["NetgearRouter", dict], list], + entity_class_generator: Callable[[NetgearRouter, dict], list], ) -> None: """Set up device tracker for Netgear component.""" router = hass.data[DOMAIN][entry.unique_id] diff --git a/homeassistant/components/nmap_tracker/device_tracker.py b/homeassistant/components/nmap_tracker/device_tracker.py index e475afd24c8a..b63280951a62 100644 --- a/homeassistant/components/nmap_tracker/device_tracker.py +++ b/homeassistant/components/nmap_tracker/device_tracker.py @@ -1,8 +1,9 @@ """Support for scanning a network with nmap.""" from __future__ import annotations +from collections.abc import Callable import logging -from typing import Any, Callable +from typing import Any import voluptuous as vol diff --git a/homeassistant/components/ovo_energy/sensor.py b/homeassistant/components/ovo_energy/sensor.py index 16fd15bfbde6..0afca4f84f2a 100644 --- a/homeassistant/components/ovo_energy/sensor.py +++ b/homeassistant/components/ovo_energy/sensor.py @@ -1,9 +1,10 @@ """Support for OVO Energy sensors.""" from __future__ import annotations +from collections.abc import Callable from dataclasses import dataclass from datetime import timedelta -from typing import Callable, Final +from typing import Final from ovoenergy import OVODailyUsage from ovoenergy.ovoenergy import OVOEnergy diff --git a/homeassistant/components/picnic/const.py b/homeassistant/components/picnic/const.py index e37f85cb28b8..5aa21fd671b9 100644 --- a/homeassistant/components/picnic/const.py +++ b/homeassistant/components/picnic/const.py @@ -1,8 +1,9 @@ """Constants for the Picnic integration.""" from __future__ import annotations +from collections.abc import Callable from dataclasses import dataclass -from typing import Any, Callable, Literal +from typing import Any, Literal from homeassistant.components.sensor import SensorEntityDescription from homeassistant.const import CURRENCY_EURO, DEVICE_CLASS_TIMESTAMP diff --git a/homeassistant/components/recorder/__init__.py b/homeassistant/components/recorder/__init__.py index b473dead17bd..1b090c331a7f 100644 --- a/homeassistant/components/recorder/__init__.py +++ b/homeassistant/components/recorder/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations import asyncio +from collections.abc import Callable import concurrent.futures from datetime import datetime, timedelta import logging @@ -9,7 +10,7 @@ import queue import sqlite3 import threading import time -from typing import Any, Callable, NamedTuple +from typing import Any, NamedTuple from sqlalchemy import create_engine, event as sqlalchemy_event, exc, func, select from sqlalchemy.exc import SQLAlchemyError diff --git a/homeassistant/components/recorder/purge.py b/homeassistant/components/recorder/purge.py index 49803117119c..bc91f7ce67eb 100644 --- a/homeassistant/components/recorder/purge.py +++ b/homeassistant/components/recorder/purge.py @@ -1,9 +1,10 @@ """Purge old data helper.""" from __future__ import annotations +from collections.abc import Callable from datetime import datetime import logging -from typing import TYPE_CHECKING, Callable +from typing import TYPE_CHECKING from sqlalchemy.orm.session import Session from sqlalchemy.sql.expression import distinct diff --git a/homeassistant/components/recorder/statistics.py b/homeassistant/components/recorder/statistics.py index 845e13d40b37..ec76cc5545b9 100644 --- a/homeassistant/components/recorder/statistics.py +++ b/homeassistant/components/recorder/statistics.py @@ -2,12 +2,12 @@ from __future__ import annotations from collections import defaultdict -from collections.abc import Iterable +from collections.abc import Callable, Iterable import dataclasses from datetime import datetime, timedelta from itertools import groupby import logging -from typing import TYPE_CHECKING, Any, Callable, Literal +from typing import TYPE_CHECKING, Any, Literal from sqlalchemy import bindparam, func from sqlalchemy.exc import SQLAlchemyError diff --git a/homeassistant/components/recorder/util.py b/homeassistant/components/recorder/util.py index 7e3948cf15b4..101915c71171 100644 --- a/homeassistant/components/recorder/util.py +++ b/homeassistant/components/recorder/util.py @@ -1,14 +1,14 @@ """SQLAlchemy util functions.""" from __future__ import annotations -from collections.abc import Generator +from collections.abc import Callable, Generator from contextlib import contextmanager from datetime import timedelta import functools import logging import os import time -from typing import TYPE_CHECKING, Callable +from typing import TYPE_CHECKING from sqlalchemy import text from sqlalchemy.exc import OperationalError, SQLAlchemyError diff --git a/homeassistant/components/renault/renault_coordinator.py b/homeassistant/components/renault/renault_coordinator.py index 64e414a9ab7c..4487d9db9ab7 100644 --- a/homeassistant/components/renault/renault_coordinator.py +++ b/homeassistant/components/renault/renault_coordinator.py @@ -1,10 +1,10 @@ """Proxy to handle account communication with Renault servers.""" from __future__ import annotations -from collections.abc import Awaitable +from collections.abc import Awaitable, Callable from datetime import timedelta import logging -from typing import Callable, TypeVar +from typing import TypeVar from renault_api.kamereon.exceptions import ( AccessDeniedException, diff --git a/homeassistant/components/renault/renault_vehicle.py b/homeassistant/components/renault/renault_vehicle.py index 90bc4a2def4e..12f5f4e86716 100644 --- a/homeassistant/components/renault/renault_vehicle.py +++ b/homeassistant/components/renault/renault_vehicle.py @@ -2,11 +2,11 @@ from __future__ import annotations import asyncio -from collections.abc import Awaitable +from collections.abc import Awaitable, Callable from dataclasses import dataclass from datetime import timedelta import logging -from typing import Callable, cast +from typing import cast from renault_api.kamereon import models from renault_api.renault_vehicle import RenaultVehicle diff --git a/homeassistant/components/renault/select.py b/homeassistant/components/renault/select.py index fa9c491030de..a8f4a15dc212 100644 --- a/homeassistant/components/renault/select.py +++ b/homeassistant/components/renault/select.py @@ -1,8 +1,9 @@ """Support for Renault sensors.""" from __future__ import annotations +from collections.abc import Callable from dataclasses import dataclass -from typing import Callable, cast +from typing import cast from renault_api.kamereon.models import KamereonVehicleBatteryStatusData diff --git a/homeassistant/components/renault/sensor.py b/homeassistant/components/renault/sensor.py index 4cb0d723234a..bcdb01a05f30 100644 --- a/homeassistant/components/renault/sensor.py +++ b/homeassistant/components/renault/sensor.py @@ -1,8 +1,9 @@ """Support for Renault sensors.""" from __future__ import annotations +from collections.abc import Callable from dataclasses import dataclass -from typing import Callable, cast +from typing import cast from renault_api.kamereon.enums import ChargeState, PlugState from renault_api.kamereon.models import ( diff --git a/homeassistant/components/rfxtrx/sensor.py b/homeassistant/components/rfxtrx/sensor.py index fd3be53bfda7..c72d2e288e13 100644 --- a/homeassistant/components/rfxtrx/sensor.py +++ b/homeassistant/components/rfxtrx/sensor.py @@ -1,9 +1,9 @@ """Support for RFXtrx sensors.""" from __future__ import annotations +from collections.abc import Callable from dataclasses import dataclass import logging -from typing import Callable from RFXtrx import ControlEvent, SensorEvent diff --git a/homeassistant/components/sonos/helpers.py b/homeassistant/components/sonos/helpers.py index 2e5b3a8c0328..01a75eb77474 100644 --- a/homeassistant/components/sonos/helpers.py +++ b/homeassistant/components/sonos/helpers.py @@ -1,9 +1,10 @@ """Helper methods for common tasks.""" from __future__ import annotations +from collections.abc import Callable import functools as ft import logging -from typing import Any, Callable +from typing import Any from soco.exceptions import SoCoException, SoCoUPnPException diff --git a/homeassistant/components/sonos/speaker.py b/homeassistant/components/sonos/speaker.py index ea49175b6650..851711c2e12e 100644 --- a/homeassistant/components/sonos/speaker.py +++ b/homeassistant/components/sonos/speaker.py @@ -2,12 +2,12 @@ from __future__ import annotations import asyncio -from collections.abc import Coroutine +from collections.abc import Callable, Coroutine import contextlib import datetime from functools import partial import logging -from typing import Any, Callable +from typing import Any import urllib.parse import async_timeout diff --git a/homeassistant/components/synology_dsm/__init__.py b/homeassistant/components/synology_dsm/__init__.py index 87eb345b03d3..a4b03ecce3d6 100644 --- a/homeassistant/components/synology_dsm/__init__.py +++ b/homeassistant/components/synology_dsm/__init__.py @@ -1,9 +1,10 @@ """The Synology DSM component.""" from __future__ import annotations +from collections.abc import Callable from datetime import timedelta import logging -from typing import Any, Callable +from typing import Any import async_timeout from synology_dsm import SynologyDSM diff --git a/homeassistant/components/tile/device_tracker.py b/homeassistant/components/tile/device_tracker.py index 27446389f507..36cd16de23a0 100644 --- a/homeassistant/components/tile/device_tracker.py +++ b/homeassistant/components/tile/device_tracker.py @@ -1,9 +1,9 @@ """Support for Tile device trackers.""" from __future__ import annotations -from collections.abc import Awaitable +from collections.abc import Awaitable, Callable import logging -from typing import Any, Callable +from typing import Any from pytile.tile import Tile diff --git a/homeassistant/components/timer/__init__.py b/homeassistant/components/timer/__init__.py index c4544a4b13f2..e4aa6be1ff13 100644 --- a/homeassistant/components/timer/__init__.py +++ b/homeassistant/components/timer/__init__.py @@ -1,9 +1,9 @@ """Support for Timers.""" from __future__ import annotations +from collections.abc import Callable from datetime import datetime, timedelta import logging -from typing import Callable import voluptuous as vol diff --git a/homeassistant/components/zha/core/decorators.py b/homeassistant/components/zha/core/decorators.py index c3eec07e980c..a27e4cc0bfcb 100644 --- a/homeassistant/components/zha/core/decorators.py +++ b/homeassistant/components/zha/core/decorators.py @@ -1,7 +1,8 @@ """Decorators for ZHA core registries.""" from __future__ import annotations -from typing import Callable, TypeVar +from collections.abc import Callable +from typing import TypeVar CALLABLE_T = TypeVar("CALLABLE_T", bound=Callable) # pylint: disable=invalid-name diff --git a/homeassistant/components/zha/core/discovery.py b/homeassistant/components/zha/core/discovery.py index 6545f14668f4..49d640c3165a 100644 --- a/homeassistant/components/zha/core/discovery.py +++ b/homeassistant/components/zha/core/discovery.py @@ -2,8 +2,8 @@ from __future__ import annotations from collections import Counter +from collections.abc import Callable import logging -from typing import Callable from homeassistant import const as ha_const from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/zha/core/helpers.py b/homeassistant/components/zha/core/helpers.py index 34359c194205..47ee682b46ee 100644 --- a/homeassistant/components/zha/core/helpers.py +++ b/homeassistant/components/zha/core/helpers.py @@ -8,14 +8,14 @@ from __future__ import annotations import asyncio import binascii -from collections.abc import Iterator +from collections.abc import Callable, Iterator from dataclasses import dataclass import functools import itertools import logging from random import uniform import re -from typing import Any, Callable +from typing import Any import voluptuous as vol import zigpy.exceptions diff --git a/homeassistant/components/zha/core/registries.py b/homeassistant/components/zha/core/registries.py index 53425e329c09..f7f35e0755db 100644 --- a/homeassistant/components/zha/core/registries.py +++ b/homeassistant/components/zha/core/registries.py @@ -2,7 +2,8 @@ from __future__ import annotations import collections -from typing import Callable, Dict +from collections.abc import Callable +from typing import Dict import attr from zigpy import zcl diff --git a/homeassistant/components/zha/core/typing.py b/homeassistant/components/zha/core/typing.py index 15e8be0db1e9..62a797d9fd5c 100644 --- a/homeassistant/components/zha/core/typing.py +++ b/homeassistant/components/zha/core/typing.py @@ -1,6 +1,6 @@ """Typing helpers for ZHA component.""" - -from typing import TYPE_CHECKING, Callable, TypeVar +from collections.abc import Callable +from typing import TYPE_CHECKING, TypeVar import zigpy.device import zigpy.endpoint diff --git a/homeassistant/components/zwave_js/__init__.py b/homeassistant/components/zwave_js/__init__.py index 7a8f284787f7..77fcf44b4d81 100644 --- a/homeassistant/components/zwave_js/__init__.py +++ b/homeassistant/components/zwave_js/__init__.py @@ -3,7 +3,7 @@ from __future__ import annotations import asyncio from collections import defaultdict -from typing import Callable +from collections.abc import Callable from async_timeout import timeout from zwave_js_server.client import Client as ZwaveClient diff --git a/homeassistant/components/zwave_js/api.py b/homeassistant/components/zwave_js/api.py index f1a4150ad1af..03bccd814db6 100644 --- a/homeassistant/components/zwave_js/api.py +++ b/homeassistant/components/zwave_js/api.py @@ -1,10 +1,11 @@ """Websocket API for Z-Wave JS.""" from __future__ import annotations +from collections.abc import Callable import dataclasses from functools import partial, wraps import json -from typing import Any, Callable +from typing import Any from aiohttp import hdrs, web, web_exceptions, web_request import voluptuous as vol diff --git a/homeassistant/components/zwave_js/helpers.py b/homeassistant/components/zwave_js/helpers.py index 4744c7f9fc1c..4894c40b8aee 100644 --- a/homeassistant/components/zwave_js/helpers.py +++ b/homeassistant/components/zwave_js/helpers.py @@ -1,7 +1,8 @@ """Helper functions for Z-Wave JS integration.""" from __future__ import annotations -from typing import Any, Callable, cast +from collections.abc import Callable +from typing import Any, cast import voluptuous as vol from zwave_js_server.client import Client as ZwaveClient