Import Callable from collections.abc (4) (#56778)

This commit is contained in:
Marc Mueller 2021-09-29 16:15:36 +02:00 committed by GitHub
parent 19685ecff0
commit 364767ff22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 50 additions and 32 deletions

View file

@ -1,8 +1,8 @@
"""Support for Daikin AC sensors.""" """Support for Daikin AC sensors."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass from dataclasses import dataclass
from typing import Callable
from pydaikin.daikin_base import Appliance from pydaikin.daikin_base import Appliance

View file

@ -1,8 +1,8 @@
"""Code to handle a DenonAVR receiver.""" """Code to handle a DenonAVR receiver."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
import logging import logging
from typing import Callable
from denonavr import DenonAVR from denonavr import DenonAVR

View file

@ -2,11 +2,11 @@
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio
from collections.abc import Coroutine, Sequence from collections.abc import Callable, Coroutine, Sequence
from datetime import timedelta from datetime import timedelta
import hashlib import hashlib
from types import ModuleType from types import ModuleType
from typing import Any, Callable, Final, final from typing import Any, Final, final
import attr import attr
import voluptuous as vol import voluptuous as vol

View file

@ -1,8 +1,9 @@
"""Code to handle a Dynalite bridge.""" """Code to handle a Dynalite bridge."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from types import MappingProxyType from types import MappingProxyType
from typing import Any, Callable from typing import Any
from dynalite_devices_lib.dynalite_devices import ( from dynalite_devices_lib.dynalite_devices import (
CONF_AREA as dyn_CONF_AREA, CONF_AREA as dyn_CONF_AREA,

View file

@ -1,7 +1,8 @@
"""Support for the Dynalite devices as entities.""" """Support for the Dynalite devices as entities."""
from __future__ import annotations from __future__ import annotations
from typing import Any, Callable from collections.abc import Callable
from typing import Any
from homeassistant.components.dynalite.bridge import DynaliteBridge from homeassistant.components.dynalite.bridge import DynaliteBridge
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry

View file

@ -1,8 +1,9 @@
"""Models for the Forecast.Solar integration.""" """Models for the Forecast.Solar integration."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass from dataclasses import dataclass
from typing import Any, Callable from typing import Any
from forecast_solar.models import Estimate from forecast_solar.models import Estimate

View file

@ -1,7 +1,8 @@
"""This platform allows several media players to be grouped into one media player.""" """This platform allows several media players to be grouped into one media player."""
from __future__ import annotations from __future__ import annotations
from typing import Any, Callable from collections.abc import Callable
from typing import Any
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,9 @@
"""Utility functions to combine state attributes from multiple entities.""" """Utility functions to combine state attributes from multiple entities."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Iterator from collections.abc import Callable, Iterator
from itertools import groupby from itertools import groupby
from typing import Any, Callable from typing import Any
from homeassistant.core import State from homeassistant.core import State

View file

@ -1,9 +1,9 @@
"""Support for IoTaWatt Energy monitor.""" """Support for IoTaWatt Energy monitor."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass from dataclasses import dataclass
import logging import logging
from typing import Callable
from iotawattpy.sensor import Sensor from iotawattpy.sensor import Sensor

View file

@ -2,10 +2,10 @@
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio
from collections.abc import Awaitable from collections.abc import Awaitable, Callable
from datetime import timedelta from datetime import timedelta
from functools import partial from functools import partial
from typing import Any, Callable, Dict, cast from typing import Any, Dict, cast
from pyiqvia import Client from pyiqvia import Client
from pyiqvia.errors import IQVIAError from pyiqvia.errors import IQVIAError

View file

@ -1,8 +1,9 @@
"""Support for KNX/IP covers.""" """Support for KNX/IP covers."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from datetime import datetime from datetime import datetime
from typing import Any, Callable from typing import Any
from xknx import XKNX from xknx import XKNX
from xknx.devices import Cover as XknxCover, Device as XknxDevice from xknx.devices import Cover as XknxCover, Device as XknxDevice

View file

@ -1,7 +1,7 @@
"""Exposures to KNX bus.""" """Exposures to KNX bus."""
from __future__ import annotations from __future__ import annotations
from typing import Callable from collections.abc import Callable
from xknx import XKNX from xknx import XKNX
from xknx.devices import DateTime, ExposeSensor from xknx.devices import DateTime, ExposeSensor

View file

@ -1,7 +1,10 @@
"""Support for Honeywell Lyric sensor platform.""" """Support for Honeywell Lyric sensor platform."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass from dataclasses import dataclass
from datetime import datetime, timedelta from datetime import datetime, timedelta
from typing import Callable, cast from typing import cast
from aiolyric.objects.device import LyricDevice from aiolyric.objects.device import LyricDevice
from aiolyric.objects.location import LyricLocation from aiolyric.objects.location import LyricLocation

View file

@ -1,7 +1,10 @@
"""Helper to handle a set of topics to subscribe to.""" """Helper to handle a set of topics to subscribe to."""
from __future__ import annotations
from collections import deque from collections import deque
from collections.abc import Callable
from functools import wraps from functools import wraps
from typing import Any, Callable from typing import Any
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant

View file

@ -1,8 +1,9 @@
"""Provides device automations for MQTT.""" """Provides device automations for MQTT."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
import logging import logging
from typing import Any, Callable from typing import Any
import attr import attr
import voluptuous as vol import voluptuous as vol

View file

@ -2,9 +2,9 @@
from __future__ import annotations from __future__ import annotations
from abc import abstractmethod from abc import abstractmethod
from collections.abc import Callable
import json import json
import logging import logging
from typing import Callable
import voluptuous as vol import voluptuous as vol

View file

@ -1,7 +1,8 @@
"""Helper to handle a set of topics to subscribe to.""" """Helper to handle a set of topics to subscribe to."""
from __future__ import annotations from __future__ import annotations
from typing import Any, Callable from collections.abc import Callable
from typing import Any
import attr import attr

View file

@ -1,9 +1,10 @@
"""Support for Google Nest SDM Cameras.""" """Support for Google Nest SDM Cameras."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
import datetime import datetime
import logging import logging
from typing import Any, Callable from typing import Any
from google_nest_sdm.camera_traits import ( from google_nest_sdm.camera_traits import (
CameraEventImageTrait, CameraEventImageTrait,

View file

@ -2,9 +2,9 @@
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio
from collections.abc import Callable
from contextlib import suppress from contextlib import suppress
import datetime as dt import datetime as dt
from typing import Callable
from httpx import RemoteProtocolError, TransportError from httpx import RemoteProtocolError, TransportError
from onvif import ONVIFCamera, ONVIFService from onvif import ONVIFCamera, ONVIFService

View file

@ -2,11 +2,11 @@
from __future__ import annotations from __future__ import annotations
from collections import defaultdict from collections import defaultdict
from collections.abc import Callable
import datetime import datetime
import itertools import itertools
import logging import logging
import math import math
from typing import Callable
from homeassistant.components.recorder import history, statistics from homeassistant.components.recorder import history, statistics
from homeassistant.components.recorder.models import ( from homeassistant.components.recorder.models import (

View file

@ -1,8 +1,8 @@
"""Support for System Bridge binary sensors.""" """Support for System Bridge binary sensors."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass from dataclasses import dataclass
from typing import Callable
from systembridge import Bridge from systembridge import Bridge

View file

@ -2,9 +2,9 @@
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio
from collections.abc import Callable
from datetime import timedelta from datetime import timedelta
import logging import logging
from typing import Callable
from systembridge import Bridge from systembridge import Bridge
from systembridge.exceptions import ( from systembridge.exceptions import (

View file

@ -1,9 +1,10 @@
"""Support for System Bridge sensors.""" """Support for System Bridge sensors."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass from dataclasses import dataclass
from datetime import datetime, timedelta from datetime import datetime, timedelta
from typing import Callable, Final, cast from typing import Final, cast
from systembridge import Bridge from systembridge import Bridge

View file

@ -1,8 +1,9 @@
"""Support for Tasmota binary sensors.""" """Support for Tasmota binary sensors."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from datetime import datetime from datetime import datetime
from typing import Any, Callable from typing import Any
from hatasmota import switch as tasmota_switch from hatasmota import switch as tasmota_switch
from hatasmota.entity import TasmotaEntity as HATasmotaEntity from hatasmota.entity import TasmotaEntity as HATasmotaEntity

View file

@ -1,8 +1,9 @@
"""Provides device automations for Tasmota.""" """Provides device automations for Tasmota."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
import logging import logging
from typing import Any, Callable from typing import Any
import attr import attr
from hatasmota.models import DiscoveryHashType from hatasmota.models import DiscoveryHashType

View file

@ -1,7 +1,9 @@
"""Support for representing current time of the day as binary sensors.""" """Support for representing current time of the day as binary sensors."""
from __future__ import annotations
from collections.abc import Callable
from datetime import datetime, timedelta from datetime import datetime, timedelta
import logging import logging
from typing import Callable
import voluptuous as vol import voluptuous as vol

View file

@ -1,10 +1,9 @@
"""Webhooks for Home Assistant.""" """Webhooks for Home Assistant."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Awaitable from collections.abc import Awaitable, Callable
import logging import logging
import secrets import secrets
from typing import Callable
from aiohttp.web import Request, Response from aiohttp.web import Request, Response
import voluptuous as vol import voluptuous as vol

View file

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio
from typing import Callable from collections.abc import Callable
from wled import WLED, Device as WLEDDevice, WLEDConnectionClosed, WLEDError from wled import WLED, Device as WLEDDevice, WLEDConnectionClosed, WLEDError