mirror of
https://github.com/home-assistant/core.git
synced 2025-04-29 03:37:51 +00:00
Update typing syntax (#49480)
* Update typing syntax * Replace typing imports with ones from collections where possible * Changes after review
This commit is contained in:
parent
34245c3add
commit
c07646db5d
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
"""Blueprint errors."""
|
"""Blueprint errors."""
|
||||||
from typing import Any, Iterable
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Iterable
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from voluptuous.humanize import humanize_error
|
from voluptuous.humanize import humanize_error
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
|
from collections.abc import Mapping
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable, Mapping
|
from typing import Any, Callable
|
||||||
|
|
||||||
from pyclimacell.const import CURRENT
|
from pyclimacell.const import CURRENT
|
||||||
|
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
|
from collections.abc import Mapping
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable, Mapping
|
from typing import Any, Callable
|
||||||
|
|
||||||
from pyclimacell.const import (
|
from pyclimacell.const import (
|
||||||
CURRENT,
|
CURRENT,
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from typing import Any, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import ATTR_TEMPERATURE
|
from homeassistant.const import ATTR_TEMPERATURE
|
||||||
from homeassistant.core import Context, HomeAssistant, State
|
from homeassistant.core import Context, HomeAssistant, State
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ENTITY_ID
|
from homeassistant.const import ATTR_ENTITY_ID
|
||||||
from homeassistant.core import Context, HomeAssistant, State
|
from homeassistant.core import Context, HomeAssistant, State
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.components.cover import (
|
from homeassistant.components.cover import (
|
||||||
ATTR_CURRENT_POSITION,
|
ATTR_CURRENT_POSITION,
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
"""Support for Denon AVR receivers using their HTTP interface."""
|
"""Support for Denon AVR receivers using their HTTP interface."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Coroutine
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
import logging
|
import logging
|
||||||
from typing import Coroutine
|
|
||||||
|
|
||||||
from denonavr import DenonAVR
|
from denonavr import DenonAVR
|
||||||
from denonavr.const import POWER_ON
|
from denonavr.const import POWER_ON
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import MutableMapping
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from types import ModuleType
|
from types import ModuleType
|
||||||
from typing import Any, MutableMapping
|
from typing import Any
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
import voluptuous_serialize
|
import voluptuous_serialize
|
||||||
|
@ -2,10 +2,11 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import 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, Sequence, final
|
from typing import Any, Callable, final
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
"""Support for the DIRECTV remote."""
|
"""Support for the DIRECTV remote."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Iterable
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable, Iterable
|
from typing import Any, Callable
|
||||||
|
|
||||||
from directv import DIRECTV, DIRECTVError
|
from directv import DIRECTV, DIRECTVError
|
||||||
|
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from types import MappingProxyType
|
from types import MappingProxyType
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
"""Common code for GogoGate2 component."""
|
"""Common code for GogoGate2 component."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Awaitable
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Awaitable, Callable, NamedTuple
|
from typing import Callable, NamedTuple
|
||||||
|
|
||||||
from gogogate2_api import AbstractGateApi, GogoGate2Api, ISmartGateApi
|
from gogogate2_api import AbstractGateApi, GogoGate2Api, ISmartGateApi
|
||||||
from gogogate2_api.common import AbstractDoor, get_door_by_id
|
from gogogate2_api.common import AbstractDoor, get_door_by_id
|
||||||
|
@ -3,9 +3,10 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
from contextvars import ContextVar
|
from contextvars import ContextVar
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable, List, cast
|
from typing import Any, List, cast
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -3,8 +3,9 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
from collections.abc import Iterator
|
||||||
import itertools
|
import itertools
|
||||||
from typing import Any, Callable, Iterator, cast
|
from typing import Any, Callable, cast
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Module that groups code required to handle state restore for component."""
|
"""Module that groups code required to handle state restore for component."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.core import Context, HomeAssistant, State
|
from homeassistant.core import Context, HomeAssistant, State
|
||||||
from homeassistant.helpers.state import async_reproduce_state
|
from homeassistant.helpers.state import async_reproduce_state
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
"""Define Guardian-specific utilities."""
|
"""Define Guardian-specific utilities."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Awaitable
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from typing import Awaitable, Callable
|
from typing import Callable
|
||||||
|
|
||||||
from aioguardian import Client
|
from aioguardian import Client
|
||||||
from aioguardian.errors import GuardianError
|
from aioguardian.errors import GuardianError
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Harmony data object which contains the Harmony Client."""
|
"""Harmony data object which contains the Harmony Client."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Iterable
|
|
||||||
|
|
||||||
from aioharmony.const import ClientCallbackType, SendCommandDevice
|
from aioharmony.const import ClientCallbackType, SendCommandDevice
|
||||||
import aioharmony.exceptions as aioexc
|
import aioharmony.exceptions as aioexc
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
"""Denon HEOS Media Player."""
|
"""Denon HEOS Media Player."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Sequence
|
||||||
from functools import reduce, wraps
|
from functools import reduce, wraps
|
||||||
import logging
|
import logging
|
||||||
from operator import ior
|
from operator import ior
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
from pyheos import HeosError, const as heos_const
|
from pyheos import HeosError, const as heos_const
|
||||||
|
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
from collections.abc import Iterable
|
||||||
from datetime import datetime as dt, timedelta
|
from datetime import datetime as dt, timedelta
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
from typing import Iterable, cast
|
from typing import cast
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
from sqlalchemy import and_, bindparam, func, not_, or_
|
from sqlalchemy import and_, bindparam, func, not_, or_
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
"""Decorator for view methods to help with data validation."""
|
"""Decorator for view methods to help with data validation."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Awaitable
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Awaitable, Callable
|
from typing import Any, Callable
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
from bisect import bisect
|
from bisect import bisect
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
from typing import Callable, NamedTuple, Pattern
|
from typing import Callable, NamedTuple
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
|
|
||||||
@ -52,8 +52,8 @@ class SensorMeta(NamedTuple):
|
|||||||
icon: str | Callable[[StateType], str] | None = None
|
icon: str | Callable[[StateType], str] | None = None
|
||||||
unit: str | None = None
|
unit: str | None = None
|
||||||
enabled_default: bool = False
|
enabled_default: bool = False
|
||||||
include: Pattern[str] | None = None
|
include: re.Pattern[str] | None = None
|
||||||
exclude: Pattern[str] | None = None
|
exclude: re.Pattern[str] | None = None
|
||||||
formatter: Callable[[str], tuple[StateType, str | None]] | None = None
|
formatter: Callable[[str], tuple[StateType, str | None]] | None = None
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_MODE,
|
ATTR_MODE,
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
"""Support for Hyperion-NG remotes."""
|
"""Support for Hyperion-NG remotes."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping, Sequence
|
||||||
import functools
|
import functools
|
||||||
import logging
|
import logging
|
||||||
from types import MappingProxyType
|
from types import MappingProxyType
|
||||||
from typing import Any, Callable, Mapping, Sequence
|
from typing import Any, Callable
|
||||||
|
|
||||||
from hyperion import client, const
|
from hyperion import client, const
|
||||||
|
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ENTITY_ID
|
from homeassistant.const import ATTR_ENTITY_ID
|
||||||
from homeassistant.core import Context, HomeAssistant, State
|
from homeassistant.core import Context, HomeAssistant, State
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from types import MappingProxyType
|
from types import MappingProxyType
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ENTITY_ID
|
from homeassistant.const import ATTR_ENTITY_ID
|
||||||
from homeassistant.core import Context, HomeAssistant, State
|
from homeassistant.core import Context, HomeAssistant, State
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ENTITY_ID
|
from homeassistant.const import ATTR_ENTITY_ID
|
||||||
from homeassistant.core import Context, HomeAssistant, State
|
from homeassistant.core import Context, HomeAssistant, State
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Support for KNX/IP binary sensors."""
|
"""Support for KNX/IP binary sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Any, Callable
|
||||||
|
|
||||||
from xknx.devices import BinarySensor as XknxBinarySensor
|
from xknx.devices import BinarySensor as XknxBinarySensor
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Support for KNX/IP climate devices."""
|
"""Support for KNX/IP climate devices."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Any, Callable
|
||||||
|
|
||||||
from xknx.devices import Climate as XknxClimate
|
from xknx.devices import Climate as XknxClimate
|
||||||
from xknx.dpt.dpt_hvac_mode import HVACControllerMode, HVACOperationMode
|
from xknx.dpt.dpt_hvac_mode import HVACControllerMode, HVACOperationMode
|
||||||
|
@ -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 Iterable
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Any, Callable, Iterable
|
from typing import Any, Callable
|
||||||
|
|
||||||
from xknx.devices import Cover as XknxCover, Device as XknxDevice
|
from xknx.devices import Cover as XknxCover, Device as XknxDevice
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
"""Support for KNX/IP fans."""
|
"""Support for KNX/IP fans."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Iterable
|
||||||
import math
|
import math
|
||||||
from typing import Any, Callable, Iterable
|
from typing import Any, Callable
|
||||||
|
|
||||||
from xknx.devices import Fan as XknxFan
|
from xknx.devices import Fan as XknxFan
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Support for KNX/IP lights."""
|
"""Support for KNX/IP lights."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Any, Callable
|
||||||
|
|
||||||
from xknx.devices import Light as XknxLight
|
from xknx.devices import Light as XknxLight
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Support for KNX scenes."""
|
"""Support for KNX scenes."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Any, Callable
|
||||||
|
|
||||||
from xknx.devices import Scene as XknxScene
|
from xknx.devices import Scene as XknxScene
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Support for KNX/IP sensors."""
|
"""Support for KNX/IP sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Any, Callable
|
||||||
|
|
||||||
from xknx.devices import Sensor as XknxSensor
|
from xknx.devices import Sensor as XknxSensor
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Support for KNX/IP switches."""
|
"""Support for KNX/IP switches."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Any, Callable
|
||||||
|
|
||||||
from xknx import XKNX
|
from xknx import XKNX
|
||||||
from xknx.devices import Switch as XknxSwitch
|
from xknx.devices import Switch as XknxSwitch
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Support for KNX/IP weather station."""
|
"""Support for KNX/IP weather station."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Callable, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Callable
|
||||||
|
|
||||||
from xknx.devices import Weather as XknxWeather
|
from xknx.devices import Weather as XknxWeather
|
||||||
|
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from types import MappingProxyType
|
from types import MappingProxyType
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from typing import Any, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
SERVICE_MEDIA_PAUSE,
|
SERVICE_MEDIA_PAUSE,
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
"""Minio helper methods."""
|
"""Minio helper methods."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Iterable
|
from collections.abc import Iterable, Iterator
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
from queue import Queue
|
from queue import Queue
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
from typing import Iterator
|
|
||||||
from urllib.parse import unquote
|
from urllib.parse import unquote
|
||||||
|
|
||||||
from minio import Minio
|
from minio import Minio
|
||||||
|
@ -3,10 +3,11 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
from collections.abc import Coroutine
|
||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
import sys
|
import sys
|
||||||
from typing import Any, Callable, Coroutine
|
from typing import Any, Callable
|
||||||
|
|
||||||
import async_timeout
|
import async_timeout
|
||||||
from mysensors import BaseAsyncGateway, Message, Sensor, mysensors
|
from mysensors import BaseAsyncGateway, Message, Sensor, mysensors
|
||||||
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
import logging
|
import logging
|
||||||
from typing import Callable, DefaultDict
|
from typing import Callable
|
||||||
|
|
||||||
from mysensors import BaseAsyncGateway, Message
|
from mysensors import BaseAsyncGateway, Message
|
||||||
from mysensors.sensor import ChildSensor
|
from mysensors.sensor import ChildSensor
|
||||||
@ -174,9 +174,9 @@ def validate_child(
|
|||||||
node_id: int,
|
node_id: int,
|
||||||
child: ChildSensor,
|
child: ChildSensor,
|
||||||
value_type: int | None = None,
|
value_type: int | None = None,
|
||||||
) -> DefaultDict[str, list[DevId]]:
|
) -> defaultdict[str, list[DevId]]:
|
||||||
"""Validate a child. Returns a dict mapping hass platform names to list of DevId."""
|
"""Validate a child. Returns a dict mapping hass platform names to list of DevId."""
|
||||||
validated: DefaultDict[str, list[DevId]] = defaultdict(list)
|
validated: defaultdict[str, list[DevId]] = defaultdict(list)
|
||||||
pres: IntEnum = gateway.const.Presentation
|
pres: IntEnum = gateway.const.Presentation
|
||||||
set_req: IntEnum = gateway.const.SetReq
|
set_req: IntEnum = gateway.const.SetReq
|
||||||
child_type_name: SensorType | None = next(
|
child_type_name: SensorType | None = next(
|
||||||
|
@ -7,7 +7,6 @@ from functools import partial
|
|||||||
from itertools import islice
|
from itertools import islice
|
||||||
import logging
|
import logging
|
||||||
from time import time
|
from time import time
|
||||||
from typing import Deque
|
|
||||||
|
|
||||||
import pyatmo
|
import pyatmo
|
||||||
|
|
||||||
@ -60,7 +59,7 @@ class NetatmoDataHandler:
|
|||||||
self.listeners: list[CALLBACK_TYPE] = []
|
self.listeners: list[CALLBACK_TYPE] = []
|
||||||
self._data_classes: dict = {}
|
self._data_classes: dict = {}
|
||||||
self.data = {}
|
self.data = {}
|
||||||
self._queue: Deque = deque()
|
self._queue = deque()
|
||||||
self._webhook: bool = False
|
self._webhook: bool = False
|
||||||
|
|
||||||
async def async_setup(self):
|
async def async_setup(self):
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ENTITY_ID
|
from homeassistant.const import ATTR_ENTITY_ID
|
||||||
from homeassistant.core import Context, State
|
from homeassistant.core import Context, State
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Awaitable
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
from typing import Awaitable, Callable
|
from typing import Callable
|
||||||
|
|
||||||
from pynws import SimpleNWS
|
from pynws import SimpleNWS
|
||||||
|
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
from collections.abc import Mapping, MutableMapping
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Mapping, MutableMapping
|
from typing import Any
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
"""This component provides support for RainMachine programs and zones."""
|
"""This component provides support for RainMachine programs and zones."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Coroutine
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Callable, Coroutine
|
from typing import Callable
|
||||||
|
|
||||||
from regenmaschine.controller import Controller
|
from regenmaschine.controller import Controller
|
||||||
from regenmaschine.errors import RequestError
|
from regenmaschine.errors import RequestError
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
"""Support to interface with universal remote control devices."""
|
"""Support to interface with universal remote control devices."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Iterable
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import functools as ft
|
import functools as ft
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable, cast, final
|
from typing import Any, cast, final
|
||||||
|
|
||||||
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 Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
"""Shark IQ Wrapper."""
|
"""Shark IQ Wrapper."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Iterable
|
|
||||||
|
|
||||||
from sharkiqpy import OperatingModes, PowerModes, Properties, SharkIqVacuum
|
from sharkiqpy import OperatingModes, PowerModes, Properties, SharkIqVacuum
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
"""The sma integration."""
|
"""The sma integration."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import List
|
|
||||||
|
|
||||||
import pysma
|
import pysma
|
||||||
|
|
||||||
@ -40,7 +41,7 @@ from .const import (
|
|||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def _parse_legacy_options(entry: ConfigEntry, sensor_def: pysma.Sensors) -> List[str]:
|
def _parse_legacy_options(entry: ConfigEntry, sensor_def: pysma.Sensors) -> list[str]:
|
||||||
"""Parse legacy configuration options.
|
"""Parse legacy configuration options.
|
||||||
|
|
||||||
This will parse the legacy CONF_SENSORS and CONF_CUSTOM configuration options
|
This will parse the legacy CONF_SENSORS and CONF_CUSTOM configuration options
|
||||||
@ -89,7 +90,7 @@ def _migrate_old_unique_ids(
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
sensor_def: pysma.Sensors,
|
sensor_def: pysma.Sensors,
|
||||||
config_sensors: List[str],
|
config_sensors: list[str],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Migrate legacy sensor entity_id format to new format."""
|
"""Migrate legacy sensor entity_id format to new format."""
|
||||||
entity_registry = er.async_get(hass)
|
entity_registry = er.async_get(hass)
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
"""SMA Solar Webconnect interface."""
|
"""SMA Solar Webconnect interface."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Coroutine
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable, Coroutine
|
from typing import Any, Callable
|
||||||
|
|
||||||
import pysma
|
import pysma
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
"""Support for SmartThings Cloud."""
|
"""Support for SmartThings Cloud."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import importlib
|
import importlib
|
||||||
import logging
|
import logging
|
||||||
from typing import Iterable
|
|
||||||
|
|
||||||
from aiohttp.client_exceptions import ClientConnectionError, ClientResponseError
|
from aiohttp.client_exceptions import ClientConnectionError, ClientResponseError
|
||||||
from pysmartapp.event import EVENT_TYPE_DEVICE
|
from pysmartapp.event import EVENT_TYPE_DEVICE
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""Support for binary sensors through the SmartThings cloud API."""
|
"""Support for binary sensors through the SmartThings cloud API."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from pysmartthings import Attribute, Capability
|
from pysmartthings import Attribute, Capability
|
||||||
|
|
||||||
|
@ -2,9 +2,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Iterable
|
from collections.abc import Iterable, Sequence
|
||||||
import logging
|
import logging
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
from pysmartthings import Attribute, Capability
|
from pysmartthings import Attribute, Capability
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""Support for covers through the SmartThings cloud API."""
|
"""Support for covers through the SmartThings cloud API."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from pysmartthings import Attribute, Capability
|
from pysmartthings import Attribute, Capability
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
"""Support for fans through the SmartThings cloud API."""
|
"""Support for fans through the SmartThings cloud API."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Sequence
|
||||||
import math
|
import math
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
from pysmartthings import Capability
|
from pysmartthings import Capability
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from pysmartthings import Capability
|
from pysmartthings import Capability
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""Support for locks through the SmartThings cloud API."""
|
"""Support for locks through the SmartThings cloud API."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from pysmartthings import Attribute, Capability
|
from pysmartthings import Attribute, Capability
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from pysmartthings import Attribute, Capability
|
from pysmartthings import Attribute, Capability
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""Support for switches through the SmartThings cloud API."""
|
"""Support for switches through the SmartThings cloud API."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from pysmartthings import Attribute, Capability
|
from pysmartthings import Attribute, Capability
|
||||||
|
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
|
from collections.abc import Iterable
|
||||||
from datetime import date, datetime, timedelta
|
from datetime import date, datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable, Iterable
|
from typing import Any, Callable
|
||||||
|
|
||||||
from requests.exceptions import ConnectTimeout, HTTPError
|
from requests.exceptions import ConnectTimeout, HTTPError
|
||||||
from solaredge import Solaredge
|
from solaredge import Solaredge
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Coroutine
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
import datetime
|
import datetime
|
||||||
import functools as ft
|
import functools as ft
|
||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
from typing import Any, Callable, Coroutine
|
from typing import Any, Callable
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
import async_timeout
|
import async_timeout
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
"""The SSDP integration."""
|
"""The SSDP integration."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Mapping
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Mapping
|
from typing import Any
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
from async_upnp_client.search import async_search
|
from async_upnp_client.search import async_search
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
"""Provide functionality to record stream."""
|
"""Provide functionality to record stream."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections import deque
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import threading
|
import threading
|
||||||
from typing import Deque
|
|
||||||
|
|
||||||
import av
|
import av
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ def async_setup_recorder(hass):
|
|||||||
"""Only here so Provider Registry works."""
|
"""Only here so Provider Registry works."""
|
||||||
|
|
||||||
|
|
||||||
def recorder_save_worker(file_out: str, segments: Deque[Segment]):
|
def recorder_save_worker(file_out: str, segments: deque[Segment]):
|
||||||
"""Handle saving stream."""
|
"""Handle saving stream."""
|
||||||
|
|
||||||
if not segments:
|
if not segments:
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Light support for switch entities."""
|
"""Light support for switch entities."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable, Sequence, cast
|
from collections.abc import Sequence
|
||||||
|
from typing import Any, Callable, cast
|
||||||
|
|
||||||
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 Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
|
@ -2,10 +2,11 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Awaitable
|
||||||
import dataclasses
|
import dataclasses
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
from typing import Awaitable, Callable
|
from typing import Callable
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import async_timeout
|
import async_timeout
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ENTITY_ID
|
from homeassistant.const import ATTR_ENTITY_ID
|
||||||
from homeassistant.core import Context, State
|
from homeassistant.core import Context, State
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
"""Support for script and automation tracing and debugging."""
|
"""Support for script and automation tracing and debugging."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections import deque
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
from itertools import count
|
from itertools import count
|
||||||
from typing import Any, Deque
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.core import Context
|
from homeassistant.core import Context
|
||||||
from homeassistant.helpers.trace import (
|
from homeassistant.helpers.trace import (
|
||||||
@ -52,7 +53,7 @@ class ActionTrace:
|
|||||||
context: Context,
|
context: Context,
|
||||||
):
|
):
|
||||||
"""Container for script trace."""
|
"""Container for script trace."""
|
||||||
self._trace: dict[str, Deque[TraceElement]] | None = None
|
self._trace: dict[str, deque[TraceElement]] | None = None
|
||||||
self._config: dict[str, Any] = config
|
self._config: dict[str, Any] = config
|
||||||
self._blueprint_inputs: dict[str, Any] = blueprint_inputs
|
self._blueprint_inputs: dict[str, Any] = blueprint_inputs
|
||||||
self.context: Context = context
|
self.context: Context = context
|
||||||
@ -67,7 +68,7 @@ class ActionTrace:
|
|||||||
trace_set_child_id(self.key, self.run_id)
|
trace_set_child_id(self.key, self.run_id)
|
||||||
trace_id_set((key, self.run_id))
|
trace_id_set((key, self.run_id))
|
||||||
|
|
||||||
def set_trace(self, trace: dict[str, Deque[TraceElement]]) -> None:
|
def set_trace(self, trace: dict[str, deque[TraceElement]]) -> None:
|
||||||
"""Set trace."""
|
"""Set trace."""
|
||||||
self._trace = trace
|
self._trace = trace
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
"""Config flow for UPNP."""
|
"""Config flow for UPNP."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from typing import Any, Mapping
|
from typing import Any
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Mapping
|
||||||
from ipaddress import IPv4Address
|
from ipaddress import IPv4Address
|
||||||
from typing import Mapping
|
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from async_upnp_client import UpnpFactory
|
from async_upnp_client import UpnpFactory
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Common vera code."""
|
"""Common vera code."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import DefaultDict, NamedTuple
|
from collections import defaultdict
|
||||||
|
from typing import NamedTuple
|
||||||
|
|
||||||
import pyvera as pv
|
import pyvera as pv
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ class ControllerData(NamedTuple):
|
|||||||
"""Controller data."""
|
"""Controller data."""
|
||||||
|
|
||||||
controller: pv.VeraController
|
controller: pv.VeraController
|
||||||
devices: DefaultDict[str, list[pv.VeraDevice]]
|
devices: defaultdict[str, list[pv.VeraDevice]]
|
||||||
scenes: list[pv.VeraScene]
|
scenes: list[pv.VeraScene]
|
||||||
config_entry: ConfigEntry
|
config_entry: ConfigEntry
|
||||||
|
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from typing import Any, Callable, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Any, Callable
|
||||||
|
|
||||||
from homeassistant.components.alarm_control_panel import (
|
from homeassistant.components.alarm_control_panel import (
|
||||||
FORMAT_NUMBER,
|
FORMAT_NUMBER,
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Support for Verisure binary sensors."""
|
"""Support for Verisure binary sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Any, Callable
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_CONNECTIVITY,
|
DEVICE_CLASS_CONNECTIVITY,
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
"""Support for Verisure cameras."""
|
"""Support for Verisure cameras."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Iterable
|
||||||
import errno
|
import errno
|
||||||
import os
|
import os
|
||||||
from typing import Any, Callable, Iterable
|
from typing import Any, Callable
|
||||||
|
|
||||||
from verisure import Error as VerisureError
|
from verisure import Error as VerisureError
|
||||||
|
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from typing import Any, Callable, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Any, Callable
|
||||||
|
|
||||||
from verisure import Error as VerisureError
|
from verisure import Error as VerisureError
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Support for Verisure sensors."""
|
"""Support for Verisure sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable, Iterable
|
from collections.abc import Iterable
|
||||||
|
from typing import Any, Callable
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
DEVICE_CLASS_HUMIDITY,
|
DEVICE_CLASS_HUMIDITY,
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
"""Support for Verisure Smartplugs."""
|
"""Support for Verisure Smartplugs."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Iterable
|
||||||
from time import monotonic
|
from time import monotonic
|
||||||
from typing import Any, Callable, Iterable
|
from typing import Any, Callable
|
||||||
|
|
||||||
from homeassistant.components.switch import SwitchEntity
|
from homeassistant.components.switch import SwitchEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from typing import Any, Callable, Hashable
|
from collections.abc import Hashable
|
||||||
|
from typing import Any, Callable
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
"""Decorators for the Websocket API."""
|
"""Decorators for the Websocket API."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Awaitable
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from typing import Awaitable, Callable
|
from typing import Callable
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.exceptions import Unauthorized
|
from homeassistant.exceptions import Unauthorized
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Generator
|
||||||
import contextlib
|
import contextlib
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Generator
|
from typing import Any
|
||||||
|
|
||||||
import async_timeout
|
import async_timeout
|
||||||
from pywemo import WeMoDevice
|
from pywemo import WeMoDevice
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
"""Xbox Remote support."""
|
"""Xbox Remote support."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Iterable
|
||||||
import re
|
import re
|
||||||
from typing import Any, Iterable
|
from typing import Any
|
||||||
|
|
||||||
from xbox.webapi.api.client import XboxLiveClient
|
from xbox.webapi.api.client import XboxLiveClient
|
||||||
from xbox.webapi.api.provider.smartglass.models import (
|
from xbox.webapi.api.provider.smartglass.models import (
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from typing import Any, Coroutine
|
from collections.abc import Coroutine
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
import zigpy.exceptions
|
import zigpy.exceptions
|
||||||
import zigpy.zcl.clusters.general as general
|
import zigpy.zcl.clusters.general as general
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""Home automation channels module for Zigbee Home Automation."""
|
"""Home automation channels module for Zigbee Home Automation."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Coroutine
|
from collections.abc import Coroutine
|
||||||
|
|
||||||
import zigpy.zcl.clusters.homeautomation as homeautomation
|
import zigpy.zcl.clusters.homeautomation as homeautomation
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
"""Lighting channels module for Zigbee Home Automation."""
|
"""Lighting channels module for Zigbee Home Automation."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Coroutine
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from typing import Coroutine
|
|
||||||
|
|
||||||
import zigpy.zcl.clusters.lighting as lighting
|
import zigpy.zcl.clusters.lighting as lighting
|
||||||
|
|
||||||
|
@ -4,8 +4,10 @@ Security channels module for Zigbee Home Automation.
|
|||||||
For more details about this component, please refer to the documentation at
|
For more details about this component, please refer to the documentation at
|
||||||
https://home-assistant.io/integrations/zha/
|
https://home-assistant.io/integrations/zha/
|
||||||
"""
|
"""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from typing import Coroutine
|
from collections.abc import Coroutine
|
||||||
|
|
||||||
from zigpy.exceptions import ZigbeeException
|
from zigpy.exceptions import ZigbeeException
|
||||||
import zigpy.zcl.clusters.security as security
|
import zigpy.zcl.clusters.security as security
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""Smart energy channels module for Zigbee Home Automation."""
|
"""Smart energy channels module for Zigbee Home Automation."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Coroutine
|
from collections.abc import Coroutine
|
||||||
|
|
||||||
import zigpy.zcl.clusters.smartenergy as smartenergy
|
import zigpy.zcl.clusters.smartenergy as smartenergy
|
||||||
|
|
||||||
|
@ -8,13 +8,14 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import binascii
|
import binascii
|
||||||
|
from collections.abc import 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, Iterator
|
from typing import Any, Callable
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
import zigpy.exceptions
|
import zigpy.exceptions
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
from collections.abc import MutableMapping
|
||||||
import datetime
|
import datetime
|
||||||
import time
|
import time
|
||||||
from typing import MutableMapping, cast
|
from typing import cast
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
|
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Awaitable
|
||||||
import functools
|
import functools
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Awaitable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import ATTR_NAME
|
from homeassistant.const import ATTR_NAME
|
||||||
from homeassistant.core import CALLBACK_TYPE, Event, callback
|
from homeassistant.core import CALLBACK_TYPE, Event, callback
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
"""Map Z-Wave nodes and values to Home Assistant entities."""
|
"""Map Z-Wave nodes and values to Home Assistant entities."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Generator
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Any, Generator
|
from typing import Any
|
||||||
|
|
||||||
from zwave_js_server.const import CommandClass
|
from zwave_js_server.const import CommandClass
|
||||||
from zwave_js_server.model.device_class import DeviceClassItem
|
from zwave_js_server.model.device_class import DeviceClassItem
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
from collections.abc import Sequence
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
from types import ModuleType
|
from types import ModuleType
|
||||||
from typing import Any, Callable, Sequence
|
from typing import Any, Callable
|
||||||
|
|
||||||
from awesomeversion import AwesomeVersion
|
from awesomeversion import AwesomeVersion
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@ -7,6 +7,7 @@ of entities and react to changes.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Awaitable, Collection, Iterable, Mapping
|
||||||
import datetime
|
import datetime
|
||||||
import enum
|
import enum
|
||||||
import functools
|
import functools
|
||||||
@ -17,19 +18,7 @@ import re
|
|||||||
import threading
|
import threading
|
||||||
from time import monotonic
|
from time import monotonic
|
||||||
from types import MappingProxyType
|
from types import MappingProxyType
|
||||||
from typing import (
|
from typing import TYPE_CHECKING, Any, Callable, Coroutine, Optional, TypeVar, cast
|
||||||
TYPE_CHECKING,
|
|
||||||
Any,
|
|
||||||
Awaitable,
|
|
||||||
Callable,
|
|
||||||
Collection,
|
|
||||||
Coroutine,
|
|
||||||
Iterable,
|
|
||||||
Mapping,
|
|
||||||
Optional,
|
|
||||||
TypeVar,
|
|
||||||
cast,
|
|
||||||
)
|
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user