Add empty line after module docstring [helpers + other] (#112707)

This commit is contained in:
Marc Mueller 2024-03-08 16:36:11 +01:00 committed by GitHub
parent c773d57d39
commit 19ab3d6daf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
284 changed files with 287 additions and 0 deletions

View file

@ -1,4 +1,5 @@
"""Start Home Assistant.""" """Start Home Assistant."""
from __future__ import annotations from __future__ import annotations
import argparse import argparse

View file

@ -1,4 +1,5 @@
"""Provide an authentication layer for Home Assistant.""" """Provide an authentication layer for Home Assistant."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Storage for auth models.""" """Storage for auth models."""
from __future__ import annotations from __future__ import annotations
from datetime import timedelta from datetime import timedelta

View file

@ -1,4 +1,5 @@
"""Constants for the auth module.""" """Constants for the auth module."""
from datetime import timedelta from datetime import timedelta
ACCESS_TOKEN_EXPIRATION = timedelta(minutes=30) ACCESS_TOKEN_EXPIRATION = timedelta(minutes=30)

View file

@ -4,6 +4,7 @@ Since we decode the same tokens over and over again
we can cache the result of the decode of valid tokens we can cache the result of the decode of valid tokens
to speed up the process. to speed up the process.
""" """
from __future__ import annotations from __future__ import annotations
from datetime import timedelta from datetime import timedelta

View file

@ -1,4 +1,5 @@
"""Pluggable auth modules for Home Assistant.""" """Pluggable auth modules for Home Assistant."""
from __future__ import annotations from __future__ import annotations
import importlib import importlib

View file

@ -1,4 +1,5 @@
"""Example auth module.""" """Example auth module."""
from __future__ import annotations from __future__ import annotations
from typing import Any from typing import Any

View file

@ -2,6 +2,7 @@
Sending HOTP through notify service Sending HOTP through notify service
""" """
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Time-based One Time Password auth module.""" """Time-based One Time Password auth module."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Auth models.""" """Auth models."""
from __future__ import annotations from __future__ import annotations
from datetime import datetime, timedelta from datetime import datetime, timedelta

View file

@ -1,4 +1,5 @@
"""Permissions for Home Assistant.""" """Permissions for Home Assistant."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable from collections.abc import Callable

View file

@ -1,4 +1,5 @@
"""Entity permissions.""" """Entity permissions."""
from __future__ import annotations from __future__ import annotations
from collections import OrderedDict from collections import OrderedDict

View file

@ -1,4 +1,5 @@
"""Permission for events.""" """Permission for events."""
from __future__ import annotations from __future__ import annotations
from typing import Final from typing import Final

View file

@ -1,4 +1,5 @@
"""Merging of policies.""" """Merging of policies."""
from __future__ import annotations from __future__ import annotations
from typing import cast from typing import cast

View file

@ -1,4 +1,5 @@
"""Models for permissions.""" """Models for permissions."""
from __future__ import annotations from __future__ import annotations
from typing import TYPE_CHECKING from typing import TYPE_CHECKING

View file

@ -1,4 +1,5 @@
"""System policies.""" """System policies."""
from .const import CAT_ENTITIES, POLICY_READ, SUBCAT_ALL from .const import CAT_ENTITIES, POLICY_READ, SUBCAT_ALL
ADMIN_POLICY = {CAT_ENTITIES: True} ADMIN_POLICY = {CAT_ENTITIES: True}

View file

@ -1,4 +1,5 @@
"""Common code for permissions.""" """Common code for permissions."""
from collections.abc import Mapping from collections.abc import Mapping
# MyPy doesn't support recursion yet. So writing it out as far as we need. # MyPy doesn't support recursion yet. So writing it out as far as we need.

View file

@ -1,4 +1,5 @@
"""Helpers to deal with permissions.""" """Helpers to deal with permissions."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable from collections.abc import Callable

View file

@ -1,4 +1,5 @@
"""Auth providers for Home Assistant.""" """Auth providers for Home Assistant."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Mapping from collections.abc import Mapping

View file

@ -1,4 +1,5 @@
"""Auth provider that validates credentials via an external command.""" """Auth provider that validates credentials via an external command."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Home Assistant auth provider.""" """Home Assistant auth provider."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Example auth provider.""" """Example auth provider."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Mapping from collections.abc import Mapping

View file

@ -2,6 +2,7 @@
It will be removed when auth system production ready It will be removed when auth system production ready
""" """
from __future__ import annotations from __future__ import annotations
from collections.abc import Mapping from collections.abc import Mapping

View file

@ -3,6 +3,7 @@
It shows list of users if access from trusted network. It shows list of users if access from trusted network.
Abort login flow if not access from trusted network. Abort login flow if not access from trusted network.
""" """
from __future__ import annotations from __future__ import annotations
from collections.abc import Mapping from collections.abc import Mapping

View file

@ -6,6 +6,7 @@ Since we have dropped support for Python 3.10, we can remove this backport.
This file is kept for now to avoid breaking custom components that might This file is kept for now to avoid breaking custom components that might
import it. import it.
""" """
from __future__ import annotations from __future__ import annotations
from enum import StrEnum from enum import StrEnum

View file

@ -1,4 +1,5 @@
"""Block blocking calls being done in asyncio.""" """Block blocking calls being done in asyncio."""
from http.client import HTTPConnection from http.client import HTTPConnection
import time import time

View file

@ -1,4 +1,5 @@
"""Provide methods to bootstrap a Home Assistant instance.""" """Provide methods to bootstrap a Home Assistant instance."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -6,6 +6,7 @@ Component design guidelines:
format "<DOMAIN>.<OBJECT_ID>". format "<DOMAIN>.<OBJECT_ID>".
- Each component should publish services only under its own domain. - Each component should publish services only under its own domain.
""" """
from __future__ import annotations from __future__ import annotations
import logging import logging

View file

@ -1,4 +1,5 @@
"""Module to help with parsing and generating configuration files.""" """Module to help with parsing and generating configuration files."""
from __future__ import annotations from __future__ import annotations
from collections import OrderedDict from collections import OrderedDict

View file

@ -1,4 +1,5 @@
"""Manage config entries in Home Assistant.""" """Manage config entries in Home Assistant."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Constants used by Home Assistant components.""" """Constants used by Home Assistant components."""
from __future__ import annotations from __future__ import annotations
from enum import StrEnum from enum import StrEnum

View file

@ -3,6 +3,7 @@
Home Assistant is a Home Automation framework for observing the state Home Assistant is a Home Automation framework for observing the state
of entities and react to changes. of entities and react to changes.
""" """
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Classes to help gather user submissions.""" """Classes to help gather user submissions."""
from __future__ import annotations from __future__ import annotations
import abc import abc

View file

@ -1,4 +1,5 @@
"""The exceptions used by Home Assistant.""" """The exceptions used by Home Assistant."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Generator, Sequence from collections.abc import Generator, Sequence

View file

@ -1,4 +1,5 @@
"""Helper methods for components within Home Assistant.""" """Helper methods for components within Home Assistant."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Iterable, Sequence from collections.abc import Iterable, Sequence

View file

@ -1,4 +1,5 @@
"""Helper for aiohttp webclient stuff.""" """Helper for aiohttp webclient stuff."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Provide a way to connect devices to one physical location.""" """Provide a way to connect devices to one physical location."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Iterable from collections.abc import Iterable

View file

@ -1,4 +1,5 @@
"""Helper to check the configuration file.""" """Helper to check the configuration file."""
from __future__ import annotations from __future__ import annotations
from collections import OrderedDict from collections import OrderedDict

View file

@ -1,4 +1,5 @@
"""Helper to deal with YAML + storage.""" """Helper to deal with YAML + storage."""
from __future__ import annotations from __future__ import annotations
from abc import ABC, abstractmethod from abc import ABC, abstractmethod

View file

@ -1,4 +1,5 @@
"""Offer reusable conditions.""" """Offer reusable conditions."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Helpers for data entry flows for config entries.""" """Helpers for data entry flows for config entries."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Awaitable, Callable from collections.abc import Awaitable, Callable

View file

@ -5,6 +5,7 @@ This module exists of the following parts:
- OAuth2 implementation that works with local provided client ID/secret - OAuth2 implementation that works with local provided client ID/secret
""" """
from __future__ import annotations from __future__ import annotations
from abc import ABC, ABCMeta, abstractmethod from abc import ABC, ABCMeta, abstractmethod

View file

@ -1,4 +1,5 @@
"""Helpers for config validation using voluptuous.""" """Helpers for config validation using voluptuous."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable, Hashable from collections.abc import Callable, Hashable

View file

@ -1,4 +1,5 @@
"""Helpers for the data entry flow.""" """Helpers for the data entry flow."""
from __future__ import annotations from __future__ import annotations
from http import HTTPStatus from http import HTTPStatus

View file

@ -1,4 +1,5 @@
"""Debounce helper.""" """Debounce helper."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Deprecation helpers for Home Assistant.""" """Deprecation helpers for Home Assistant."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable from collections.abc import Callable

View file

@ -1,4 +1,5 @@
"""Provide a way to connect entities belonging to one device.""" """Provide a way to connect entities belonging to one device."""
from __future__ import annotations from __future__ import annotations
from collections import UserDict from collections import UserDict

View file

@ -5,6 +5,7 @@ There are two different types of discoveries that can be fired/listened for.
- listen_platform/discover_platform is for platforms. These are used by - listen_platform/discover_platform is for platforms. These are used by
components to allow discovery of their platforms. components to allow discovery of their platforms.
""" """
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable, Coroutine from collections.abc import Callable, Coroutine

View file

@ -1,4 +1,5 @@
"""The discovery flow helper.""" """The discovery flow helper."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Coroutine from collections.abc import Coroutine

View file

@ -1,4 +1,5 @@
"""Helpers for Home Assistant dispatcher & internal component/platform.""" """Helpers for Home Assistant dispatcher & internal component/platform."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable, Coroutine from collections.abc import Callable, Coroutine

View file

@ -1,4 +1,5 @@
"""An abstract class for entities.""" """An abstract class for entities."""
from __future__ import annotations from __future__ import annotations
from abc import ABCMeta from abc import ABCMeta

View file

@ -1,4 +1,5 @@
"""Helpers for components that manage entities.""" """Helpers for components that manage entities."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Class to manage the entities for a single platform.""" """Class to manage the entities for a single platform."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -7,6 +7,7 @@ The Entity Registry will persist itself 10 seconds after a new entity is
registered. Registering a new entity while a timer is in progress resets the registered. Registering a new entity while a timer is in progress resets the
timer. timer.
""" """
from __future__ import annotations from __future__ import annotations
from collections import UserDict from collections import UserDict

View file

@ -1,4 +1,5 @@
"""A class to hold entity values.""" """A class to hold entity values."""
from __future__ import annotations from __future__ import annotations
from collections import OrderedDict from collections import OrderedDict

View file

@ -1,4 +1,5 @@
"""Helper class to implement include/exclude of entities and domains.""" """Helper class to implement include/exclude of entities and domains."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable from collections.abc import Callable

View file

@ -1,4 +1,5 @@
"""Helpers for listening to events.""" """Helpers for listening to events."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Provide a way to assign areas to floors in one's home.""" """Provide a way to assign areas to floors in one's home."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Iterable from collections.abc import Iterable

View file

@ -1,4 +1,5 @@
"""Provide frame helper for finding the current frame context.""" """Provide frame helper for finding the current frame context."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Helper for groups.""" """Helper for groups."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Iterable from collections.abc import Iterable

View file

@ -1,4 +1,5 @@
"""Helper to track the current http request.""" """Helper to track the current http request."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Helper for httpx.""" """Helper for httpx."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable from collections.abc import Callable

View file

@ -1,4 +1,5 @@
"""Icon helper methods.""" """Icon helper methods."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Helper to create a unique instance ID.""" """Helper to create a unique instance ID."""
from __future__ import annotations from __future__ import annotations
import logging import logging

View file

@ -1,4 +1,5 @@
"""Helpers to help with integration platforms.""" """Helpers to help with integration platforms."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Persistently store issues raised by integrations.""" """Persistently store issues raised by integrations."""
from __future__ import annotations from __future__ import annotations
import dataclasses import dataclasses

View file

@ -1,4 +1,5 @@
"""Helpers to help with encoding Home Assistant objects in JSON.""" """Helpers to help with encoding Home Assistant objects in JSON."""
from collections import deque from collections import deque
from collections.abc import Callable from collections.abc import Callable
import datetime import datetime

View file

@ -1,4 +1,5 @@
"""Provide a way to label and group anything.""" """Provide a way to label and group anything."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Iterable from collections.abc import Iterable

View file

@ -1,4 +1,5 @@
"""Location helpers for Home Assistant.""" """Location helpers for Home Assistant."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Iterable from collections.abc import Iterable

View file

@ -1,4 +1,5 @@
"""Network helpers.""" """Network helpers."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable from collections.abc import Callable

View file

@ -1,4 +1,5 @@
"""Provide a base class for registries that use a normalized name index.""" """Provide a base class for registries that use a normalized name index."""
from collections import UserDict from collections import UserDict
from collections.abc import ValuesView from collections.abc import ValuesView
from dataclasses import dataclass from dataclasses import dataclass

View file

@ -1,4 +1,5 @@
"""Ratelimit helper.""" """Ratelimit helper."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Helpers to redact sensitive data.""" """Helpers to redact sensitive data."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable, Iterable, Mapping from collections.abc import Callable, Iterable, Mapping

View file

@ -1,4 +1,5 @@
"""Provide a base implementation for registries.""" """Provide a base implementation for registries."""
from __future__ import annotations from __future__ import annotations
from abc import ABC, abstractmethod from abc import ABC, abstractmethod

View file

@ -1,4 +1,5 @@
"""Class to reload platforms.""" """Class to reload platforms."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Support for restoring entity states on startup.""" """Support for restoring entity states on startup."""
from __future__ import annotations from __future__ import annotations
from abc import ABC, abstractmethod from abc import ABC, abstractmethod

View file

@ -1,4 +1,5 @@
"""Helpers for creating schema based data entry flows.""" """Helpers for creating schema based data entry flows."""
from __future__ import annotations from __future__ import annotations
from abc import ABC, abstractmethod from abc import ABC, abstractmethod

View file

@ -1,4 +1,5 @@
"""Helpers to execute scripts.""" """Helpers to execute scripts."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Script variables.""" """Script variables."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Mapping from collections.abc import Mapping

View file

@ -1,4 +1,5 @@
"""Selectors for Home Assistant.""" """Selectors for Home Assistant."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable, Mapping, Sequence from collections.abc import Callable, Mapping, Sequence

View file

@ -1,4 +1,5 @@
"""Common functions related to sensor device management.""" """Common functions related to sensor device management."""
from __future__ import annotations from __future__ import annotations
from typing import TYPE_CHECKING from typing import TYPE_CHECKING

View file

@ -1,4 +1,5 @@
"""Service calling related helpers.""" """Service calling related helpers."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""MQTT Discovery data.""" """MQTT Discovery data."""
from dataclasses import dataclass from dataclasses import dataclass
import datetime as dt import datetime as dt

View file

@ -26,6 +26,7 @@ The following cases will never be passed to your function:
- if either state is unknown/unavailable - if either state is unknown/unavailable
- state adding/removing - state adding/removing
""" """
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable from collections.abc import Callable

View file

@ -1,4 +1,5 @@
"""Helper to help coordinating calls.""" """Helper to help coordinating calls."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Helpers to help during startup.""" """Helpers to help during startup."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable, Coroutine from collections.abc import Callable, Coroutine

View file

@ -1,4 +1,5 @@
"""Helpers that help with state related things.""" """Helpers that help with state related things."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Helper to help store data.""" """Helper to help store data."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Helpers for sun events.""" """Helpers for sun events."""
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable from collections.abc import Callable

View file

@ -1,4 +1,5 @@
"""Helper to gather system info.""" """Helper to gather system info."""
from __future__ import annotations from __future__ import annotations
from functools import cache from functools import cache

View file

@ -1,4 +1,5 @@
"""Temperature helpers for Home Assistant.""" """Temperature helpers for Home Assistant."""
from __future__ import annotations from __future__ import annotations
from numbers import Number from numbers import Number

View file

@ -1,4 +1,5 @@
"""Template helper methods for rendering strings with Home Assistant data.""" """Template helper methods for rendering strings with Home Assistant data."""
from __future__ import annotations from __future__ import annotations
from ast import literal_eval from ast import literal_eval

View file

@ -1,4 +1,5 @@
"""Helpers for script and condition tracing.""" """Helpers for script and condition tracing."""
from __future__ import annotations from __future__ import annotations
from collections import deque from collections import deque

View file

@ -1,4 +1,5 @@
"""Translation string lookup helpers.""" """Translation string lookup helpers."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Triggers.""" """Triggers."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""TemplateEntity utility class.""" """TemplateEntity utility class."""
from __future__ import annotations from __future__ import annotations
import contextlib import contextlib

View file

@ -1,4 +1,5 @@
"""Typing Helpers for Home Assistant.""" """Typing Helpers for Home Assistant."""
from collections.abc import Mapping from collections.abc import Mapping
from enum import Enum from enum import Enum
from typing import Any, TypeVar from typing import Any, TypeVar

View file

@ -1,4 +1,5 @@
"""Helpers to help coordinate updates.""" """Helpers to help coordinate updates."""
from __future__ import annotations from __future__ import annotations
from abc import abstractmethod from abc import abstractmethod

View file

@ -3,6 +3,7 @@
This module has quite some complex parts. I have tried to add as much This module has quite some complex parts. I have tried to add as much
documentation as possible to keep it understandable. documentation as possible to keep it understandable.
""" """
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

View file

@ -1,4 +1,5 @@
"""Module to handle installing requirements.""" """Module to handle installing requirements."""
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio

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