Remove import annotations from core (#169547)

This commit is contained in:
epenet
2026-04-30 20:34:43 +02:00
committed by GitHub
parent 9224856919
commit 7169d52010
159 changed files with 0 additions and 318 deletions
-2
View File
@@ -1,7 +1,5 @@
"""Start Home Assistant."""
from __future__ import annotations
import argparse
from contextlib import suppress
import faulthandler
-2
View File
@@ -1,7 +1,5 @@
"""Provide an authentication layer for Home Assistant."""
from __future__ import annotations
import asyncio
from collections import OrderedDict
from collections.abc import Mapping
-2
View File
@@ -1,7 +1,5 @@
"""Storage for auth models."""
from __future__ import annotations
from datetime import timedelta
import hmac
import itertools
-2
View File
@@ -5,8 +5,6 @@ we can cache the result of the decode of valid tokens
to speed up the process.
"""
from __future__ import annotations
from collections.abc import Container, Iterable, Sequence
from datetime import timedelta
from functools import lru_cache
@@ -1,7 +1,5 @@
"""Pluggable auth modules for Home Assistant."""
from __future__ import annotations
import logging
import types
from typing import Any
@@ -1,7 +1,5 @@
"""Example auth module."""
from __future__ import annotations
from typing import Any
import voluptuous as vol
-2
View File
@@ -3,8 +3,6 @@
Sending HOTP through notify service
"""
from __future__ import annotations
import asyncio
import logging
from typing import Any, cast
-2
View File
@@ -1,7 +1,5 @@
"""Time-based One Time Password auth module."""
from __future__ import annotations
import asyncio
from io import BytesIO
from typing import Any, cast
-2
View File
@@ -1,7 +1,5 @@
"""Auth models."""
from __future__ import annotations
from datetime import datetime, timedelta
from ipaddress import IPv4Address, IPv6Address
import secrets
@@ -1,7 +1,5 @@
"""Permissions for Home Assistant."""
from __future__ import annotations
from collections.abc import Callable, Iterable
from typing import TYPE_CHECKING
@@ -1,7 +1,5 @@
"""Entity permissions."""
from __future__ import annotations
from collections import OrderedDict
from collections.abc import Callable
-2
View File
@@ -1,7 +1,5 @@
"""Permission for events."""
from __future__ import annotations
from typing import Any, Final
from homeassistant.const import (
-2
View File
@@ -1,7 +1,5 @@
"""Merging of policies."""
from __future__ import annotations
from typing import cast
from .types import CategoryType, PolicyType
-2
View File
@@ -1,7 +1,5 @@
"""Models for permissions."""
from __future__ import annotations
from typing import TYPE_CHECKING
import attr
-2
View File
@@ -1,7 +1,5 @@
"""Helpers to deal with permissions."""
from __future__ import annotations
from collections.abc import Callable
from functools import wraps
from typing import cast
-2
View File
@@ -1,7 +1,5 @@
"""Auth providers for Home Assistant."""
from __future__ import annotations
from collections.abc import Mapping
import logging
import types
@@ -1,7 +1,5 @@
"""Auth provider that validates credentials via an external command."""
from __future__ import annotations
import asyncio
from collections.abc import Mapping
import logging
@@ -1,7 +1,5 @@
"""Home Assistant auth provider."""
from __future__ import annotations
import asyncio
import base64
from collections.abc import Mapping
@@ -1,7 +1,5 @@
"""Example auth provider."""
from __future__ import annotations
from collections.abc import Mapping
import hmac
@@ -4,8 +4,6 @@ It shows list of users if access from trusted network.
Abort login flow if not access from trusted network.
"""
from __future__ import annotations
from collections.abc import Mapping
from ipaddress import (
IPv4Address,
-2
View File
@@ -1,7 +1,5 @@
"""Home Assistant module to handle restoring backups."""
from __future__ import annotations
from collections.abc import Iterable
from dataclasses import dataclass
import json
-2
View File
@@ -1,7 +1,5 @@
"""Provide methods to bootstrap a Home Assistant instance."""
from __future__ import annotations
import asyncio
from collections import defaultdict
import contextlib
-2
View File
@@ -1,7 +1,5 @@
"""Module to help with parsing and generating configuration files."""
from __future__ import annotations
import asyncio
from collections import OrderedDict
from collections.abc import Callable, Hashable, Iterable, Sequence
-2
View File
@@ -1,7 +1,5 @@
"""Manage config entries in Home Assistant."""
from __future__ import annotations
import asyncio
from collections import UserDict, defaultdict
from collections.abc import (
-2
View File
@@ -1,7 +1,5 @@
"""Constants used by Home Assistant components."""
from __future__ import annotations
from enum import StrEnum
from typing import TYPE_CHECKING, Final
-2
View File
@@ -4,8 +4,6 @@ Home Assistant is a Home Automation framework for observing the state
of entities and react to changes.
"""
from __future__ import annotations
import asyncio
from collections import UserDict, defaultdict
from collections.abc import (
-2
View File
@@ -1,7 +1,5 @@
"""Module to help with parsing and generating configuration files."""
from __future__ import annotations
from collections import OrderedDict
from collections.abc import Sequence
from contextlib import suppress
-2
View File
@@ -1,7 +1,5 @@
"""Classes to help gather user submissions."""
from __future__ import annotations
import abc
import asyncio
from collections import defaultdict
-2
View File
@@ -1,7 +1,5 @@
"""The exceptions used by Home Assistant."""
from __future__ import annotations
from collections.abc import Callable, Generator, Sequence
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any
-2
View File
@@ -1,7 +1,5 @@
"""Helper for aiohttp webclient stuff."""
from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Callable, Sequence
from contextlib import suppress
-2
View File
@@ -1,7 +1,5 @@
"""Provide a way to connect devices to one physical location."""
from __future__ import annotations
from collections import defaultdict
from collections.abc import Iterable
import dataclasses
@@ -1,7 +1,5 @@
"""Provide a way to categorize things within a defined scope."""
from __future__ import annotations
from collections.abc import Iterable
import dataclasses
from dataclasses import dataclass, field
-2
View File
@@ -1,7 +1,5 @@
"""Helper to organize chat sessions between integrations."""
from __future__ import annotations
from collections.abc import Generator
from contextlib import contextmanager
from contextvars import ContextVar
-2
View File
@@ -1,7 +1,5 @@
"""Helper to deal with YAML + storage."""
from __future__ import annotations
from abc import abstractmethod
import asyncio
from collections.abc import Awaitable, Callable, Coroutine, Iterable
-2
View File
@@ -1,7 +1,5 @@
"""Offer reusable conditions."""
from __future__ import annotations
import abc
from collections import deque
from collections.abc import Callable, Container, Coroutine, Generator, Iterable, Mapping
@@ -1,7 +1,5 @@
"""Helpers for data entry flows for config entries."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
import logging
from typing import TYPE_CHECKING, Any, cast
@@ -6,8 +6,6 @@ This module exists of the following parts:
"""
from __future__ import annotations
from abc import ABC, ABCMeta, abstractmethod
import asyncio
from asyncio import Lock
@@ -1,7 +1,5 @@
"""Helpers for config validation using voluptuous."""
from __future__ import annotations
from collections.abc import Callable, Hashable, Mapping
import contextlib
from contextvars import ContextVar
-2
View File
@@ -1,7 +1,5 @@
"""Helpers for the data entry flow."""
from __future__ import annotations
from http import HTTPStatus
from typing import Any, Generic, TypeVar
-2
View File
@@ -1,7 +1,5 @@
"""Debounce helper."""
from __future__ import annotations
import asyncio
from collections.abc import AsyncGenerator, Callable
from contextlib import asynccontextmanager
-2
View File
@@ -1,7 +1,5 @@
"""Deprecation helpers for Home Assistant."""
from __future__ import annotations
from collections.abc import Callable
from contextlib import suppress
from enum import EnumType, IntEnum, IntFlag, StrEnum, _EnumDict
-2
View File
@@ -1,7 +1,5 @@
"""Provide a way to connect entities belonging to one device."""
from __future__ import annotations
import asyncio
from collections import defaultdict
from collections.abc import Iterable, Mapping
-2
View File
@@ -6,8 +6,6 @@ There are two different types of discoveries that can be fired/listened for.
components to allow discovery of their platforms.
"""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from typing import Any, TypedDict
-2
View File
@@ -1,7 +1,5 @@
"""The discovery flow helper."""
from __future__ import annotations
from collections.abc import Coroutine
import dataclasses
from typing import TYPE_CHECKING, Any, NamedTuple, Self
-2
View File
@@ -1,7 +1,5 @@
"""Helpers for Home Assistant dispatcher & internal component/platform."""
from __future__ import annotations
from collections import defaultdict
from collections.abc import Callable, Coroutine
from functools import partial
@@ -1,7 +1,5 @@
"""Helpers for components that manage entities."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Coroutine, Iterable, Mapping
from datetime import timedelta
-2
View File
@@ -1,7 +1,5 @@
"""Class to manage the entities for a single platform."""
from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Callable, Coroutine, Iterable, Mapping
from contextvars import ContextVar
-2
View File
@@ -8,8 +8,6 @@ registered. Registering a new entity while a timer is in progress resets the
timer.
"""
from __future__ import annotations
from collections import defaultdict
from collections.abc import Callable, Hashable, KeysView, Mapping
from datetime import datetime, timedelta
-2
View File
@@ -1,7 +1,5 @@
"""A class to hold entity values."""
from __future__ import annotations
import fnmatch
from functools import lru_cache
import re
-2
View File
@@ -1,7 +1,5 @@
"""Helper class to implement include/exclude of entities and domains."""
from __future__ import annotations
from collections.abc import Callable
import fnmatch
from functools import lru_cache, partial
-2
View File
@@ -1,7 +1,5 @@
"""Helpers for listening to events."""
from __future__ import annotations
import asyncio
from collections import defaultdict
from collections.abc import Callable, Coroutine, Iterable, Mapping, Sequence
-2
View File
@@ -1,7 +1,5 @@
"""Provide a way to assign areas to floors in one's home."""
from __future__ import annotations
from collections import defaultdict
from collections.abc import Iterable
import dataclasses
-2
View File
@@ -1,7 +1,5 @@
"""Provide frame helper for finding the current frame context."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
import enum
-2
View File
@@ -1,7 +1,5 @@
"""Helper for groups."""
from __future__ import annotations
from collections.abc import Iterable
from typing import TYPE_CHECKING, Any
@@ -1,7 +1,5 @@
"""Helpers for helper integrations."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from typing import Any
-2
View File
@@ -1,7 +1,5 @@
"""Helper to track the current http request."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from contextvars import ContextVar
from http import HTTPStatus
-2
View File
@@ -1,7 +1,5 @@
"""Helper for httpx."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
import sys
from types import TracebackType
-2
View File
@@ -1,7 +1,5 @@
"""Icon helper methods."""
from __future__ import annotations
import asyncio
from collections.abc import Iterable
from functools import lru_cache
-2
View File
@@ -1,7 +1,5 @@
"""Helper to import modules from asyncio."""
from __future__ import annotations
import asyncio
import importlib
import logging
-2
View File
@@ -1,7 +1,5 @@
"""Helper to create a unique instance ID."""
from __future__ import annotations
import logging
import uuid
@@ -1,7 +1,5 @@
"""Helpers to help with integration platforms."""
from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
-2
View File
@@ -1,7 +1,5 @@
"""Module to coordinate user intentions."""
from __future__ import annotations
from abc import abstractmethod
import asyncio
from collections.abc import Callable, Collection, Coroutine, Iterable
-2
View File
@@ -1,7 +1,5 @@
"""Persistently store issues raised by integrations."""
from __future__ import annotations
import dataclasses
from datetime import datetime
from enum import StrEnum
-2
View File
@@ -1,7 +1,5 @@
"""Provide a way to label and group anything."""
from __future__ import annotations
from collections.abc import Iterable
import dataclasses
from dataclasses import dataclass
-2
View File
@@ -1,7 +1,5 @@
"""Module to coordinate llm tools."""
from __future__ import annotations
from abc import ABC, abstractmethod
from collections.abc import Callable
from dataclasses import dataclass, field as dc_field
-2
View File
@@ -1,7 +1,5 @@
"""Location helpers for Home Assistant."""
from __future__ import annotations
from collections.abc import Iterable
import logging
-2
View File
@@ -1,7 +1,5 @@
"""Network helpers."""
from __future__ import annotations
from collections.abc import Callable
from contextlib import suppress
from ipaddress import ip_address
-2
View File
@@ -1,7 +1,5 @@
"""Ratelimit helper."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Hashable
import logging
-2
View File
@@ -1,7 +1,5 @@
"""Helpers to check recorder."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Generator
from contextlib import contextmanager
-2
View File
@@ -1,7 +1,5 @@
"""Helpers to redact sensitive data."""
from __future__ import annotations
from collections.abc import Callable, Iterable, Mapping
from typing import Any, cast, overload
-2
View File
@@ -1,7 +1,5 @@
"""Provide a base implementation for registries."""
from __future__ import annotations
from abc import ABC, abstractmethod
from collections import UserDict, defaultdict
from collections.abc import Mapping, Sequence, ValuesView
-2
View File
@@ -1,7 +1,5 @@
"""Class to reload platforms."""
from __future__ import annotations
import asyncio
from collections.abc import Iterable
import logging
-2
View File
@@ -1,7 +1,5 @@
"""Support for restoring entity states on startup."""
from __future__ import annotations
from abc import ABC, abstractmethod
from datetime import datetime, timedelta
import logging
@@ -1,7 +1,5 @@
"""Helpers for creating schema based data entry flows."""
from __future__ import annotations
from abc import ABC, abstractmethod
from collections.abc import Callable, Container, Coroutine, Mapping
import copy
-2
View File
@@ -1,7 +1,5 @@
"""Helpers to execute scripts."""
from __future__ import annotations
import asyncio
from collections.abc import AsyncGenerator, Callable, Mapping, Sequence
from contextlib import asynccontextmanager
@@ -1,7 +1,5 @@
"""Script variables."""
from __future__ import annotations
from collections import ChainMap, UserDict
from collections.abc import Mapping
from dataclasses import dataclass, field
-2
View File
@@ -1,7 +1,5 @@
"""Selectors for Home Assistant."""
from __future__ import annotations
from collections.abc import Callable, Mapping, Sequence
from copy import deepcopy
from enum import StrEnum
-2
View File
@@ -1,7 +1,5 @@
"""Common functions related to sensor device management."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant import const
-2
View File
@@ -1,7 +1,5 @@
"""Service calling related helpers."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Coroutine, Iterable, Mapping, Sequence
import dataclasses
@@ -27,8 +27,6 @@ The following cases will never be passed to your function:
- state adding/removing
"""
from __future__ import annotations
from collections.abc import Callable, Mapping
import math
from types import MappingProxyType
-2
View File
@@ -1,7 +1,5 @@
"""Helper to help coordinating calls."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Coroutine
import functools
-2
View File
@@ -1,7 +1,5 @@
"""Helpers to help during startup."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from typing import Any
-2
View File
@@ -1,7 +1,5 @@
"""Helpers that help with state related things."""
from __future__ import annotations
import asyncio
from collections import defaultdict
from collections.abc import Iterable
-2
View File
@@ -1,7 +1,5 @@
"""Helper to help store data."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Iterable, Mapping, Sequence
from contextlib import suppress
-2
View File
@@ -1,7 +1,5 @@
"""Helpers for sun events."""
from __future__ import annotations
from collections.abc import Callable
import datetime
from typing import TYPE_CHECKING, Any, cast
-2
View File
@@ -1,7 +1,5 @@
"""Helper to gather system info."""
from __future__ import annotations
from functools import cache
from getpass import getuser
import logging
-2
View File
@@ -1,7 +1,5 @@
"""Helpers for dealing with entity targets."""
from __future__ import annotations
import abc
from collections.abc import Callable
import dataclasses
-2
View File
@@ -1,7 +1,5 @@
"""Temperature helpers for Home Assistant."""
from __future__ import annotations
from numbers import Number
from homeassistant.const import PRECISION_HALVES, PRECISION_TENTHS
@@ -1,7 +1,5 @@
"""Template helper methods for rendering strings with Home Assistant data."""
from __future__ import annotations
from ast import literal_eval
import asyncio
import collections.abc
@@ -1,7 +1,5 @@
"""Template context management for Home Assistant."""
from __future__ import annotations
from contextlib import AbstractContextManager
from contextvars import ContextVar
from types import TracebackType
@@ -1,7 +1,5 @@
"""Area functions for Home Assistant templates."""
from __future__ import annotations
from collections.abc import Iterable
from typing import TYPE_CHECKING
@@ -1,7 +1,5 @@
"""Base extension class for Home Assistant template extensions."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from functools import wraps
@@ -1,7 +1,5 @@
"""Base64 encoding and decoding functions for Home Assistant templates."""
from __future__ import annotations
import base64
from typing import TYPE_CHECKING
@@ -1,7 +1,5 @@
"""Collection and data structure functions for Home Assistant templates."""
from __future__ import annotations
from collections.abc import Iterable, MutableSequence
import random
from typing import TYPE_CHECKING, Any
@@ -1,7 +1,5 @@
"""Config entry functions for Home Assistant templates."""
from __future__ import annotations
from collections.abc import Iterable
from typing import TYPE_CHECKING, Any
@@ -1,7 +1,5 @@
"""Cryptographic hash functions for Home Assistant templates."""
from __future__ import annotations
import hashlib
from typing import TYPE_CHECKING
@@ -1,7 +1,5 @@
"""DateTime functions for Home Assistant templates."""
from __future__ import annotations
from datetime import date, datetime, time, timedelta
from typing import TYPE_CHECKING, Any
@@ -1,7 +1,5 @@
"""Device functions for Home Assistant templates."""
from __future__ import annotations
from collections.abc import Iterable
from typing import TYPE_CHECKING, Any
@@ -1,7 +1,5 @@
"""Entity functions for Home Assistant templates."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.helpers import entity_registry as er
@@ -1,7 +1,5 @@
"""Floor functions for Home Assistant templates."""
from __future__ import annotations
from collections.abc import Iterable
from typing import TYPE_CHECKING, Any

Some files were not shown because too many files have changed in this diff Show More