Import Callable from collections.abc (3) (#56777)

This commit is contained in:
Marc Mueller
2021-09-29 16:19:06 +02:00
committed by GitHub
parent 364767ff22
commit d51487f82a
49 changed files with 85 additions and 61 deletions
+2 -1
View File
@@ -1,8 +1,9 @@
"""Support for the Airly sensor service."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any, Callable, cast
from typing import Any, cast
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
+2 -1
View File
@@ -1,9 +1,10 @@
"""Represent the AsusWrt router."""
from __future__ import annotations
from collections.abc import Callable
from datetime import datetime, timedelta
import logging
from typing import Any, Callable
from typing import Any
from aioasuswrt.asuswrt import AsusWrt
@@ -1,10 +1,11 @@
"""Support for August binary sensors."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from datetime import datetime, timedelta
import logging
from typing import Callable, cast
from typing import cast
from yalexs.activity import (
ACTION_DOORBELL_CALL_MISSED,
+2 -1
View File
@@ -1,9 +1,10 @@
"""Support for August sensors."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
import logging
from typing import Callable, Generic, TypeVar
from typing import Generic, TypeVar
from yalexs.activity import ActivityType
from yalexs.keypad import KeypadDetail
@@ -2,10 +2,10 @@
from __future__ import annotations
import asyncio
from collections.abc import Awaitable
from collections.abc import Awaitable, Callable
from datetime import datetime, timedelta
import logging
from typing import Any, Callable, Final
from typing import Any, Final
import bluetooth # pylint: disable=import-error
from bt_proximity import BluetoothRSSI
@@ -1,7 +1,8 @@
"""Flow handler for Crownstone."""
from __future__ import annotations
from typing import Any, Callable
from collections.abc import Callable
from typing import Any
from crownstone_cloud import CrownstoneCloud
from crownstone_cloud.exceptions import (
@@ -1,7 +1,6 @@
"""Subscriber for devolo home control API publisher."""
from collections.abc import Callable
import logging
from typing import Callable
_LOGGER = logging.getLogger(__name__)
+2 -2
View File
@@ -3,8 +3,8 @@ from __future__ import annotations
import asyncio
from collections import Counter
from collections.abc import Awaitable
from typing import Callable, Literal, Optional, TypedDict, Union, cast
from collections.abc import Awaitable, Callable
from typing import Literal, Optional, TypedDict, Union, cast
import voluptuous as vol
@@ -2,8 +2,9 @@
from __future__ import annotations
import asyncio
from collections.abc import Callable
from dataclasses import dataclass, field
from typing import Any, Callable, cast
from typing import Any, cast
from aioesphomeapi import (
COMPONENT_TYPE_TO_INFO,
@@ -1,10 +1,10 @@
"""The Fjäråskupan integration."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from datetime import timedelta
import logging
from typing import Callable
from bleak import BleakScanner
from bleak.backends.device import BLEDevice
@@ -1,8 +1,8 @@
"""Support for sensors."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Callable
from fjaraskupan import Device, State
+2 -2
View File
@@ -1,12 +1,12 @@
"""Support for AVM FRITZ!Box classes."""
from __future__ import annotations
from collections.abc import ValuesView
from collections.abc import Callable, ValuesView
from dataclasses import dataclass, field
from datetime import datetime, timedelta
import logging
from types import MappingProxyType
from typing import Any, Callable, TypedDict
from typing import Any, TypedDict
from fritzconnection import FritzConnection
from fritzconnection.core.exceptions import (
+2 -1
View File
@@ -1,9 +1,10 @@
"""AVM FRITZ!Box binary sensors."""
from __future__ import annotations
from collections.abc import Callable
import datetime
import logging
from typing import Callable, TypedDict
from typing import TypedDict
from fritzconnection.core.exceptions import (
FritzActionError,
+1 -1
View File
@@ -1,8 +1,8 @@
"""Type definitions for GIOS integration."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Callable
from homeassistant.components.sensor import SensorEntityDescription
+2 -2
View File
@@ -1,10 +1,10 @@
"""Common code for GogoGate2 component."""
from __future__ import annotations
from collections.abc import Awaitable, Mapping
from collections.abc import Awaitable, Callable, Mapping
from datetime import timedelta
import logging
from typing import Any, Callable, NamedTuple
from typing import Any, NamedTuple
from ismartgate import AbstractGateApi, GogoGate2Api, ISmartGateApi
from ismartgate.common import AbstractDoor, get_door_by_id
+2 -1
View File
@@ -1,11 +1,12 @@
"""Support for GTFS (Google/General Transport Format Schema)."""
from __future__ import annotations
from collections.abc import Callable
import datetime
import logging
import os
import threading
from typing import Any, Callable
from typing import Any
import pygtfs
from sqlalchemy.sql import text
+2 -2
View File
@@ -2,9 +2,9 @@
from __future__ import annotations
import asyncio
from collections.abc import Awaitable
from collections.abc import Awaitable, Callable
from datetime import timedelta
from typing import Any, Callable, Dict, cast
from typing import Any, Dict, cast
from aioguardian import Client
from aioguardian.errors import GuardianError
@@ -2,9 +2,10 @@
from __future__ import annotations
import asyncio
from collections.abc import Callable
from contextlib import suppress
import logging
from typing import Any, Callable, cast
from typing import Any, cast
from awesomeversion import AwesomeVersion
from hyperion import client, const as hyperion_const
+2 -2
View File
@@ -1,11 +1,11 @@
"""Support for Hyperion-NG remotes."""
from __future__ import annotations
from collections.abc import Mapping, Sequence
from collections.abc import Callable, Mapping, Sequence
import functools
import logging
from types import MappingProxyType
from typing import Any, Callable
from typing import Any
from hyperion import client, const
@@ -1,9 +1,10 @@
"""Platform for Kostal Plenticore sensors."""
from __future__ import annotations
from collections.abc import Callable
from datetime import timedelta
import logging
from typing import Any, Callable
from typing import Any
from homeassistant.components.sensor import ATTR_STATE_CLASS, SensorEntity
from homeassistant.config_entries import ConfigEntry
+2 -1
View File
@@ -1,8 +1,9 @@
"""Constants for the kraken integration."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Callable, Dict, TypedDict
from typing import Dict, TypedDict
from homeassistant.components.sensor import SensorEntityDescription
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
+1 -1
View File
@@ -1,8 +1,8 @@
"""Support for LCN devices."""
from __future__ import annotations
from collections.abc import Callable
import logging
from typing import Callable
import pypck
+1 -1
View File
@@ -1,5 +1,5 @@
"""Trigger an automation when a LiteJet switch is released."""
from typing import Callable
from collections.abc import Callable
import voluptuous as vol
+2 -1
View File
@@ -1,8 +1,9 @@
"""Support for MelCloud device sensors."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any, Callable
from typing import Any
from pymelcloud import DEVICE_TYPE_ATA, DEVICE_TYPE_ATW
from pymelcloud.atw_device import Zone
@@ -2,10 +2,11 @@
from __future__ import annotations
from abc import abstractmethod
from collections.abc import Callable
from datetime import datetime, timedelta
import logging
import struct
from typing import Any, Callable, cast
from typing import Any, cast
from homeassistant.const import (
CONF_ADDRESS,
+2 -1
View File
@@ -3,8 +3,9 @@ from __future__ import annotations
import asyncio
from collections import namedtuple
from collections.abc import Callable
import logging
from typing import Any, Callable
from typing import Any
from pymodbus.client.sync import (
BaseModbusClient,
+1 -2
View File
@@ -1,10 +1,9 @@
"""The National Weather Service integration."""
from __future__ import annotations
from collections.abc import Awaitable
from collections.abc import Awaitable, Callable
import datetime
import logging
from typing import Callable
from pynws import SimpleNWS
@@ -2,9 +2,10 @@
from __future__ import annotations
import asyncio
from collections.abc import Callable
from datetime import timedelta
import logging
from typing import Any, Callable
from typing import Any
from haphilipsjs import ConnectionFailure, PhilipsTV
+2 -1
View File
@@ -2,9 +2,10 @@
from __future__ import annotations
import asyncio
from collections.abc import Callable
from dataclasses import dataclass
import logging
from typing import Any, Callable, Final, cast
from typing import Any, Final, cast
from aioshelly.block_device import Block
import async_timeout
+1 -1
View File
@@ -1,7 +1,7 @@
"""Describe Shelly logbook events."""
from __future__ import annotations
from typing import Callable
from collections.abc import Callable
from homeassistant.const import ATTR_DEVICE_ID
from homeassistant.core import HomeAssistant, callback
+1 -1
View File
@@ -1,11 +1,11 @@
"""Support for Sensirion SHT31 temperature and humidity sensor."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from datetime import timedelta
import logging
import math
from typing import Callable
from Adafruit_SHT31 import SHT31
import voluptuous as vol
@@ -2,8 +2,8 @@
from __future__ import annotations
import asyncio
from collections.abc import Awaitable
from typing import Callable, cast
from collections.abc import Awaitable, Callable
from typing import cast
from uuid import UUID
from simplipy import get_api
+2 -1
View File
@@ -1,8 +1,9 @@
"""StarLine Account."""
from __future__ import annotations
from collections.abc import Callable
from datetime import datetime, timedelta
from typing import Any, Callable
from typing import Any
from starline import StarlineApi, StarlineDevice
+1 -1
View File
@@ -1,7 +1,7 @@
"""StarLine base entity."""
from __future__ import annotations
from typing import Callable
from collections.abc import Callable
from homeassistant.helpers.entity import Entity
+2 -2
View File
@@ -2,12 +2,12 @@
from __future__ import annotations
from collections import defaultdict, deque
from collections.abc import Generator, Iterator, Mapping
from collections.abc import Callable, Generator, Iterator, Mapping
import datetime
from io import BytesIO
import logging
from threading import Event
from typing import Any, Callable, cast
from typing import Any, cast
import av
@@ -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 aioswitcher.bridge import SwitcherBase, SwitcherBridge
@@ -2,11 +2,10 @@
from __future__ import annotations
import asyncio
from collections.abc import Awaitable
from collections.abc import Awaitable, Callable
import dataclasses
from datetime import datetime
import logging
from typing import Callable
import aiohttp
import async_timeout
@@ -2,8 +2,8 @@
from __future__ import annotations
import asyncio
from collections.abc import Callable
import logging
from typing import Callable
from homeassistant import config as conf_util
from homeassistant.const import (
@@ -1,8 +1,9 @@
"""TemplateEntity utility class."""
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 @@
"""Base class for IKEA TRADFRI."""
from __future__ import annotations
from collections.abc import Callable
from functools import wraps
import logging
from typing import Any, Callable
from typing import Any
from pytradfri.command import Command
from pytradfri.device import Device
+2 -1
View File
@@ -1,7 +1,8 @@
"""Support for IKEA Tradfri covers."""
from __future__ import annotations
from typing import Any, Callable, cast
from collections.abc import Callable
from typing import Any, cast
from pytradfri.command import Command
+2 -1
View File
@@ -1,7 +1,8 @@
"""Support for IKEA Tradfri lights."""
from __future__ import annotations
from typing import Any, Callable, cast
from collections.abc import Callable
from typing import Any, cast
from pytradfri.command import Command
+2 -1
View File
@@ -1,7 +1,8 @@
"""Support for IKEA Tradfri sensors."""
from __future__ import annotations
from typing import Any, Callable, cast
from collections.abc import Callable
from typing import Any, cast
from pytradfri.command import Command
+2 -1
View File
@@ -1,7 +1,8 @@
"""Support for IKEA Tradfri switches."""
from __future__ import annotations
from typing import Any, Callable, cast
from collections.abc import Callable
from typing import Any, cast
from pytradfri.command import Command
+2 -1
View File
@@ -1,10 +1,11 @@
"""The ViCare integration."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
import enum
import logging
from typing import Callable, Generic, TypeVar
from typing import Generic, TypeVar
from PyViCare.PyViCareDevice import Device
from PyViCare.PyViCareFuelCell import FuelCell
@@ -2,8 +2,8 @@
from __future__ import annotations
import asyncio
from collections.abc import Hashable
from typing import TYPE_CHECKING, Any, Callable
from collections.abc import Callable, Hashable
from typing import TYPE_CHECKING, Any
import voluptuous as vol
@@ -2,8 +2,9 @@
from __future__ import annotations
import asyncio
from collections.abc import Callable
from functools import wraps
from typing import Any, Callable
from typing import Any
import voluptuous as vol
+2 -1
View File
@@ -2,13 +2,14 @@
from __future__ import annotations
import asyncio
from collections.abc import Callable
from dataclasses import dataclass
import datetime
from datetime import timedelta
from enum import Enum, IntEnum
import logging
import re
from typing import Any, Callable, Dict
from typing import Any, Dict
from aiohttp.web import Response
import requests
@@ -1,9 +1,9 @@
"""Support for Xiaomi Miio binary sensors."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from enum import Enum
from typing import Callable
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,