mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 13:47:35 +00:00
Update typing - collections.abc (2) (#63934)
This commit is contained in:
parent
eafece3651
commit
67c35652f0
@ -1,8 +1,9 @@
|
|||||||
"""Allow to set up simple automation rules via the config file."""
|
"""Allow to set up simple automation rules via the config file."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Awaitable, Callable
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Awaitable, Callable, TypedDict, cast
|
from typing import Any, TypedDict, cast
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from voluptuous.humanize import humanize_error
|
from voluptuous.humanize import humanize_error
|
||||||
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
import asyncio
|
import asyncio
|
||||||
import base64
|
import base64
|
||||||
import collections
|
import collections
|
||||||
from collections.abc import Iterable, Mapping
|
from collections.abc import Awaitable, Callable, Iterable, 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 Awaitable, Callable, Final, Optional, cast, final
|
from typing import Final, Optional, cast, final
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
import async_timeout
|
import async_timeout
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
"""Config flow for DLNA DMR."""
|
"""Config flow for DLNA DMR."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable, Mapping
|
||||||
import logging
|
import logging
|
||||||
from pprint import pformat
|
from pprint import pformat
|
||||||
from typing import Any, Mapping, Optional, cast
|
from typing import Any, Optional, cast
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from async_upnp_client.client import UpnpError
|
from async_upnp_client.client import UpnpError
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Types for the energy platform."""
|
"""Types for the energy platform."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Awaitable, Callable, TypedDict
|
from collections.abc import Awaitable, Callable
|
||||||
|
from typing import TypedDict
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
|
@ -3,11 +3,12 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
from collections.abc import Awaitable, Callable
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import functools
|
import functools
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from types import ModuleType
|
from types import ModuleType
|
||||||
from typing import Any, Awaitable, Callable, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
"""Support for esphome devices."""
|
"""Support for esphome devices."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Callable
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
import functools
|
import functools
|
||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
from typing import Any, Callable, Generic, NamedTuple, TypeVar, cast, overload
|
from typing import Any, Generic, NamedTuple, TypeVar, cast, overload
|
||||||
|
|
||||||
from aioesphomeapi import (
|
from aioesphomeapi import (
|
||||||
APIClient,
|
APIClient,
|
||||||
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from ast import literal_eval
|
from ast import literal_eval
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Awaitable, Callable
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
from functools import lru_cache, partial, wraps
|
from functools import lru_cache, partial, wraps
|
||||||
@ -12,7 +13,7 @@ import logging
|
|||||||
from operator import attrgetter
|
from operator import attrgetter
|
||||||
import ssl
|
import ssl
|
||||||
import time
|
import time
|
||||||
from typing import Any, Awaitable, Callable, Union, cast
|
from typing import Any, Union, cast
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
"""Modesl used by multiple MQTT modules."""
|
"""Modesl used by multiple MQTT modules."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Awaitable, Callable
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
from typing import Awaitable, Callable, Union
|
from typing import Union
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""The pvpc_hourly_pricing integration to collect Spain official electric prices."""
|
"""The pvpc_hourly_pricing integration to collect Spain official electric prices."""
|
||||||
|
from collections.abc import Mapping
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Mapping
|
|
||||||
|
|
||||||
from aiopvpc import DEFAULT_POWER_KW, TARIFFS, PVPCData
|
from aiopvpc import DEFAULT_POWER_KW, TARIFFS, PVPCData
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable, Mapping
|
from collections.abc import Awaitable, Callable, Mapping
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from ipaddress import IPv4Address, IPv6Address
|
from ipaddress import IPv4Address, IPv6Address
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from async_upnp_client.aiohttp import AiohttpSessionRequester
|
from async_upnp_client.aiohttp import AiohttpSessionRequester
|
||||||
from async_upnp_client.const import DeviceOrServiceType, SsdpHeaders, SsdpSource
|
from async_upnp_client.const import DeviceOrServiceType, SsdpHeaders, SsdpSource
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
"""Support for Tasmota device discovery."""
|
"""Support for Tasmota device discovery."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Awaitable, Callable
|
||||||
import logging
|
import logging
|
||||||
from typing import Awaitable, Callable
|
|
||||||
|
|
||||||
from hatasmota.discovery import (
|
from hatasmota.discovery import (
|
||||||
TasmotaDiscovery,
|
TasmotaDiscovery,
|
||||||
|
@ -2,16 +2,17 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from collections.abc import Awaitable, Callable
|
||||||
from concurrent import futures
|
from concurrent import futures
|
||||||
from functools import partial
|
from functools import partial
|
||||||
import json
|
import json
|
||||||
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Final
|
from typing import TYPE_CHECKING, Any, Final
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.json import JSONEncoder
|
from homeassistant.helpers.json import JSONEncoder
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .connection import ActiveConnection
|
from .connection import ActiveConnection # noqa: F401
|
||||||
|
|
||||||
|
|
||||||
WebSocketCommandHandler = Callable[
|
WebSocketCommandHandler = Callable[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user