mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Import Callable from collections.abc (2) (#56776)
This commit is contained in:
parent
41e5f05d99
commit
565a9fea6b
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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]
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 (
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user