Import Callable from collections.abc (2) (#56776)
This commit is contained in:
parent
41e5f05d99
commit
565a9fea6b
53 changed files with 100 additions and 65 deletions
|
@ -1,12 +1,13 @@
|
||||||
"""Support for Amcrest IP cameras."""
|
"""Support for Amcrest IP cameras."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
from amcrest import AmcrestError, ApiWrapper, LoginError
|
from amcrest import AmcrestError, ApiWrapper, LoginError
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
"""Support for Amcrest IP camera binary sensors."""
|
"""Support for Amcrest IP camera binary sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING, Callable
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from amcrest import AmcrestError
|
from amcrest import AmcrestError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
|
@ -2,10 +2,11 @@
|
||||||
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
|
||||||
from functools import partial
|
from functools import partial
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING, Any, Callable
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
from amcrest import AmcrestError
|
from amcrest import AmcrestError
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
"""Support for Amcrest IP camera sensors."""
|
"""Support for Amcrest IP camera sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING, Callable
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from amcrest import AmcrestError
|
from amcrest import AmcrestError
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,11 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Callable
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from azure.eventhub import EventData, EventDataBatch
|
from azure.eventhub import EventData, EventDataBatch
|
||||||
from azure.eventhub.aio import EventHubProducerClient, EventHubSharedKeyCredential
|
from azure.eventhub.aio import EventHubProducerClient, EventHubSharedKeyCredential
|
||||||
|
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
||||||
import asyncio
|
import asyncio
|
||||||
import base64
|
import base64
|
||||||
import collections
|
import collections
|
||||||
from collections.abc import Awaitable, Mapping
|
from collections.abc import Awaitable, Callable, Mapping
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
@ -14,7 +14,7 @@ import inspect
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from random import SystemRandom
|
from random import SystemRandom
|
||||||
from typing import Callable, Final, cast, final
|
from typing import Final, cast, final
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
import async_timeout
|
import async_timeout
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
"""Constants for the ClimaCell integration."""
|
"""Constants for the ClimaCell integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from pyclimacell.const import (
|
from pyclimacell.const import (
|
||||||
DAILY,
|
DAILY,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""Describe deCONZ logbook events."""
|
"""Describe deCONZ logbook events."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Callable
|
from collections.abc import Callable
|
||||||
|
|
||||||
from homeassistant.const import ATTR_DEVICE_ID, CONF_EVENT
|
from homeassistant.const import ATTR_DEVICE_ID, CONF_EVENT
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
"""Definitions for DSMR Reader sensors added to MQTT."""
|
"""Definitions for DSMR Reader sensors added to MQTT."""
|
||||||
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, Final
|
from typing import Final
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
"""Code to handle pins on a Firmata board."""
|
"""Code to handle pins on a Firmata board."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
import logging
|
import logging
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from .board import FirmataBoard, FirmataPinType
|
from .board import FirmataBoard, FirmataPinType
|
||||||
from .const import PIN_MODE_INPUT, PIN_MODE_PULLUP, PIN_TYPE_ANALOG
|
from .const import PIN_MODE_INPUT, PIN_MODE_PULLUP, PIN_TYPE_ANALOG
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
"""Support for Fritzbox binary sensors."""
|
"""Support for Fritzbox 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, Final
|
from typing import Final
|
||||||
|
|
||||||
from pyfritzhome.fritzhomedevice import FritzhomeDevice
|
from pyfritzhome.fritzhomedevice import FritzhomeDevice
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
"""Models for the AVM FRITZ!SmartHome integration."""
|
"""Models for the AVM FRITZ!SmartHome 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 Callable, TypedDict
|
from typing import TypedDict
|
||||||
|
|
||||||
from pyfritzhome import FritzhomeDevice
|
from pyfritzhome import FritzhomeDevice
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
"""Support for AVM FRITZ!SmartHome temperature sensor only devices."""
|
"""Support for AVM FRITZ!SmartHome temperature sensor only devices."""
|
||||||
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, Final
|
from typing import Final
|
||||||
|
|
||||||
from pyfritzhome.fritzhomedevice import FritzhomeDevice
|
from pyfritzhome.fritzhomedevice import FritzhomeDevice
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
"""API for persistent storage for the frontend."""
|
"""API for persistent storage for the frontend."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Callable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from homematicip.aio.auth import AsyncAuth
|
from homematicip.aio.auth import AsyncAuth
|
||||||
from homematicip.aio.home import AsyncHome
|
from homematicip.aio.home import AsyncHome
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
"""Decorator for view methods to help with data validation."""
|
"""Decorator for view methods to help with data validation."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable, Callable
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
|
@ -2,11 +2,12 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
from collections.abc import Callable
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
from typing import Any, Callable, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
from huawei_lte_api.AuthorizedConnection import AuthorizedConnection
|
from huawei_lte_api.AuthorizedConnection import AuthorizedConnection
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from bisect import bisect
|
from bisect import bisect
|
||||||
|
from collections.abc import Callable
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
from typing import Callable, NamedTuple
|
from typing import NamedTuple
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
"""Support for sending data to an Influx database."""
|
"""Support for sending data to an Influx database."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
import logging
|
import logging
|
||||||
|
@ -8,7 +9,7 @@ import math
|
||||||
import queue
|
import queue
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from influxdb import InfluxDBClient, exceptions
|
from influxdb import InfluxDBClient, exceptions
|
||||||
from influxdb_client import InfluxDBClient as InfluxDBClientV2
|
from influxdb_client import InfluxDBClient as InfluxDBClientV2
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
"""The Keenetic Client class."""
|
"""The Keenetic Client class."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from ndms2_client import Client, ConnectionException, Device, TelnetConnection
|
from ndms2_client import Client, ConnectionException, Device, TelnetConnection
|
||||||
from ndms2_client.client import RouterInfo
|
from ndms2_client.client import RouterInfo
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
"""Helpers for mobile_app."""
|
"""Helpers for mobile_app."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from aiohttp.web import Response, json_response
|
from aiohttp.web import Response, json_response
|
||||||
from nacl.encoding import Base64Encoder
|
from nacl.encoding import Base64Encoder
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
"""Push notification handling."""
|
"""Push notification handling."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from typing import Callable
|
from collections.abc import Callable
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.event import async_call_later
|
from homeassistant.helpers.event import async_call_later
|
||||||
|
|
|
@ -2,10 +2,11 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Callable
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
from types import MappingProxyType
|
from types import MappingProxyType
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
from urllib.parse import urlencode, urljoin
|
from urllib.parse import urlencode, urljoin
|
||||||
|
|
||||||
from aiohttp.web import Request, Response
|
from aiohttp.web import Request, Response
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Callable
|
||||||
from functools import partial
|
from functools import partial
|
||||||
import logging
|
import logging
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from mysensors import BaseAsyncGateway
|
from mysensors import BaseAsyncGateway
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
"""Support for tracking MySensors devices."""
|
"""Support for tracking MySensors devices."""
|
||||||
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 import mysensors
|
from homeassistant.components import mysensors
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
|
|
|
@ -3,11 +3,11 @@ from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from collections.abc import Coroutine
|
from collections.abc import Callable, Coroutine
|
||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
import sys
|
import sys
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
import async_timeout
|
import async_timeout
|
||||||
from mysensors import BaseAsyncGateway, Message, Sensor, mysensors
|
from mysensors import BaseAsyncGateway, Message, Sensor, mysensors
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
from collections.abc import Callable
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
import logging
|
import logging
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from mysensors import BaseAsyncGateway, Message
|
from mysensors import BaseAsyncGateway, Message
|
||||||
from mysensors.sensor import ChildSensor
|
from mysensors.sensor import ChildSensor
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
"""Represent the Netgear router and its devices."""
|
"""Represent the Netgear router and its devices."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
|
from collections.abc import Callable
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from pynetgear import Netgear
|
from pynetgear import Netgear
|
||||||
|
|
||||||
|
@ -62,7 +64,7 @@ def async_setup_netgear_entry(
|
||||||
hass: HomeAssistantType,
|
hass: HomeAssistantType,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: AddEntitiesCallback,
|
async_add_entities: AddEntitiesCallback,
|
||||||
entity_class_generator: Callable[["NetgearRouter", dict], list],
|
entity_class_generator: Callable[[NetgearRouter, dict], list],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up device tracker for Netgear component."""
|
"""Set up device tracker for Netgear component."""
|
||||||
router = hass.data[DOMAIN][entry.unique_id]
|
router = hass.data[DOMAIN][entry.unique_id]
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
"""Support for scanning a network with nmap."""
|
"""Support for scanning a network with nmap."""
|
||||||
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 voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
"""Support for OVO Energy sensors."""
|
"""Support for OVO Energy 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 timedelta
|
from datetime import timedelta
|
||||||
from typing import Callable, Final
|
from typing import Final
|
||||||
|
|
||||||
from ovoenergy import OVODailyUsage
|
from ovoenergy import OVODailyUsage
|
||||||
from ovoenergy.ovoenergy import OVOEnergy
|
from ovoenergy.ovoenergy import OVOEnergy
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
"""Constants for the Picnic integration."""
|
"""Constants for the Picnic 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, Literal
|
from typing import Any, Literal
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntityDescription
|
from homeassistant.components.sensor import SensorEntityDescription
|
||||||
from homeassistant.const import CURRENCY_EURO, DEVICE_CLASS_TIMESTAMP
|
from homeassistant.const import CURRENCY_EURO, DEVICE_CLASS_TIMESTAMP
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Callable
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
|
@ -9,7 +10,7 @@ import queue
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import threading
|
import threading
|
||||||
import time
|
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 import create_engine, event as sqlalchemy_event, exc, func, select
|
||||||
from sqlalchemy.exc import SQLAlchemyError
|
from sqlalchemy.exc import SQLAlchemyError
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
"""Purge old data helper."""
|
"""Purge old data helper."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING, Callable
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sqlalchemy.orm.session import Session
|
from sqlalchemy.orm.session import Session
|
||||||
from sqlalchemy.sql.expression import distinct
|
from sqlalchemy.sql.expression import distinct
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from collections.abc import Iterable
|
from collections.abc import Callable, Iterable
|
||||||
import dataclasses
|
import dataclasses
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING, Any, Callable, Literal
|
from typing import TYPE_CHECKING, Any, Literal
|
||||||
|
|
||||||
from sqlalchemy import bindparam, func
|
from sqlalchemy import bindparam, func
|
||||||
from sqlalchemy.exc import SQLAlchemyError
|
from sqlalchemy.exc import SQLAlchemyError
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
"""SQLAlchemy util functions."""
|
"""SQLAlchemy util functions."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Generator
|
from collections.abc import Callable, Generator
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import functools
|
import functools
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from typing import TYPE_CHECKING, Callable
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sqlalchemy import text
|
from sqlalchemy import text
|
||||||
from sqlalchemy.exc import OperationalError, SQLAlchemyError
|
from sqlalchemy.exc import OperationalError, SQLAlchemyError
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
"""Proxy to handle account communication with Renault servers."""
|
"""Proxy to handle account communication with Renault servers."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable, Callable
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Callable, TypeVar
|
from typing import TypeVar
|
||||||
|
|
||||||
from renault_api.kamereon.exceptions import (
|
from renault_api.kamereon.exceptions import (
|
||||||
AccessDeniedException,
|
AccessDeniedException,
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable, Callable
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Callable, cast
|
from typing import cast
|
||||||
|
|
||||||
from renault_api.kamereon import models
|
from renault_api.kamereon import models
|
||||||
from renault_api.renault_vehicle import RenaultVehicle
|
from renault_api.renault_vehicle import RenaultVehicle
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
"""Support for Renault sensors."""
|
"""Support for Renault 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, cast
|
from typing import cast
|
||||||
|
|
||||||
from renault_api.kamereon.models import KamereonVehicleBatteryStatusData
|
from renault_api.kamereon.models import KamereonVehicleBatteryStatusData
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
"""Support for Renault sensors."""
|
"""Support for Renault 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, cast
|
from typing import cast
|
||||||
|
|
||||||
from renault_api.kamereon.enums import ChargeState, PlugState
|
from renault_api.kamereon.enums import ChargeState, PlugState
|
||||||
from renault_api.kamereon.models import (
|
from renault_api.kamereon.models import (
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
"""Support for RFXtrx sensors."""
|
"""Support for RFXtrx sensors."""
|
||||||
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 RFXtrx import ControlEvent, SensorEvent
|
from RFXtrx import ControlEvent, SensorEvent
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
"""Helper methods for common tasks."""
|
"""Helper methods for common tasks."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
import functools as ft
|
import functools as ft
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from soco.exceptions import SoCoException, SoCoUPnPException
|
from soco.exceptions import SoCoException, SoCoUPnPException
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Coroutine
|
from collections.abc import Callable, Coroutine
|
||||||
import contextlib
|
import contextlib
|
||||||
import datetime
|
import datetime
|
||||||
from functools import partial
|
from functools import partial
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
import async_timeout
|
import async_timeout
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
"""The Synology DSM component."""
|
"""The Synology DSM component."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
import async_timeout
|
import async_timeout
|
||||||
from synology_dsm import SynologyDSM
|
from synology_dsm import SynologyDSM
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
"""Support for Tile device trackers."""
|
"""Support for Tile device trackers."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable, Callable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from pytile.tile import Tile
|
from pytile.tile import Tile
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
"""Support for Timers."""
|
"""Support for Timers."""
|
||||||
from __future__ import annotations
|
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
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
"""Decorators for ZHA core registries."""
|
"""Decorators for ZHA core registries."""
|
||||||
from __future__ import annotations
|
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
|
CALLABLE_T = TypeVar("CALLABLE_T", bound=Callable) # pylint: disable=invalid-name
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
from collections.abc import Callable
|
||||||
import logging
|
import logging
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from homeassistant import const as ha_const
|
from homeassistant import const as ha_const
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
|
|
|
@ -8,14 +8,14 @@ from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import binascii
|
import binascii
|
||||||
from collections.abc import Iterator
|
from collections.abc import Callable, Iterator
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
import functools
|
import functools
|
||||||
import itertools
|
import itertools
|
||||||
import logging
|
import logging
|
||||||
from random import uniform
|
from random import uniform
|
||||||
import re
|
import re
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
import zigpy.exceptions
|
import zigpy.exceptions
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
from typing import Callable, Dict
|
from collections.abc import Callable
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
from zigpy import zcl
|
from zigpy import zcl
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Typing helpers for ZHA component."""
|
"""Typing helpers for ZHA component."""
|
||||||
|
from collections.abc import Callable
|
||||||
from typing import TYPE_CHECKING, Callable, TypeVar
|
from typing import TYPE_CHECKING, TypeVar
|
||||||
|
|
||||||
import zigpy.device
|
import zigpy.device
|
||||||
import zigpy.endpoint
|
import zigpy.endpoint
|
||||||
|
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from typing import Callable
|
from collections.abc import Callable
|
||||||
|
|
||||||
from async_timeout import timeout
|
from async_timeout import timeout
|
||||||
from zwave_js_server.client import Client as ZwaveClient
|
from zwave_js_server.client import Client as ZwaveClient
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
"""Websocket API for Z-Wave JS."""
|
"""Websocket API for Z-Wave JS."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
import dataclasses
|
import dataclasses
|
||||||
from functools import partial, wraps
|
from functools import partial, wraps
|
||||||
import json
|
import json
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from aiohttp import hdrs, web, web_exceptions, web_request
|
from aiohttp import hdrs, web, web_exceptions, web_request
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
"""Helper functions for Z-Wave JS integration."""
|
"""Helper functions for Z-Wave JS integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable, cast
|
from collections.abc import Callable
|
||||||
|
from typing import Any, cast
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from zwave_js_server.client import Client as ZwaveClient
|
from zwave_js_server.client import Client as ZwaveClient
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue