Remove quotes surrounding annotations (#117817)

This commit is contained in:
Marc Mueller 2024-05-20 22:06:58 +02:00 committed by GitHub
parent 1ad8151bd1
commit bc2ee96cae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 59 additions and 23 deletions

View file

@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.core import HomeAssistant, callback
@ -12,7 +14,7 @@ from .const import DOMAIN
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.exclude_domain(DOMAIN)

View file

@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.const import (
@ -22,7 +24,7 @@ if TYPE_CHECKING:
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.on_off_states(

View file

@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.const import STATE_OFF, STATE_ON
@ -13,7 +15,7 @@ if TYPE_CHECKING:
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.on_off_states(

View file

@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.const import STATE_CLOSED, STATE_OPEN
@ -13,7 +15,7 @@ if TYPE_CHECKING:
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
# On means open, Off means closed

View file

@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.const import STATE_HOME, STATE_NOT_HOME
@ -13,7 +15,7 @@ if TYPE_CHECKING:
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.on_off_states(DOMAIN, {STATE_HOME}, STATE_HOME, STATE_NOT_HOME)

View file

@ -1,5 +1,7 @@
"""Models for the HomeKit component."""
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING
@ -11,6 +13,6 @@ if TYPE_CHECKING:
class HomeKitEntryData:
"""Class to hold HomeKit data."""
homekit: "HomeKit"
homekit: HomeKit
pairing_qr: bytes | None = None
pairing_qr_secret: str | None = None

View file

@ -1,5 +1,7 @@
"""Handles Hue resource of type `device` mapping to Home Assistant device."""
from __future__ import annotations
from typing import TYPE_CHECKING
from aiohue.v2 import HueBridgeV2
@ -27,7 +29,7 @@ if TYPE_CHECKING:
from ..bridge import HueBridge
async def async_setup_devices(bridge: "HueBridge"):
async def async_setup_devices(bridge: HueBridge):
"""Manage setup of devices from Hue devices."""
entry = bridge.config_entry
hass = bridge.hass

View file

@ -1,5 +1,7 @@
"""Handle forward of events transmitted by Hue devices to HASS."""
from __future__ import annotations
import logging
from typing import TYPE_CHECKING
@ -25,7 +27,7 @@ if TYPE_CHECKING:
LOGGER = logging.getLogger(__name__)
async def async_setup_hue_events(bridge: "HueBridge"):
async def async_setup_hue_events(bridge: HueBridge):
"""Manage listeners for stateless Hue sensors that emit events."""
hass = bridge.hass
api: HueBridgeV2 = bridge.api # to satisfy typing

View file

@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.const import (
@ -20,7 +22,7 @@ if TYPE_CHECKING:
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.on_off_states(

View file

@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.const import (
@ -19,7 +21,7 @@ if TYPE_CHECKING:
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.on_off_states(

View file

@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.const import STATE_HOME, STATE_NOT_HOME
@ -13,7 +15,7 @@ if TYPE_CHECKING:
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.on_off_states(DOMAIN, {STATE_HOME}, STATE_HOME, STATE_NOT_HOME)

View file

@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.const import STATE_OK, STATE_PROBLEM
@ -13,7 +15,7 @@ if TYPE_CHECKING:
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.on_off_states(DOMAIN, {STATE_PROBLEM}, STATE_PROBLEM, STATE_OK)

View file

@ -1,5 +1,7 @@
"""Managers for each table."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from lru import LRU
@ -13,9 +15,9 @@ if TYPE_CHECKING:
class BaseTableManager[_DataT]:
"""Base class for table managers."""
_id_map: "LRU[EventType[Any] | str, int]"
_id_map: LRU[EventType[Any] | str, int]
def __init__(self, recorder: "Recorder") -> None:
def __init__(self, recorder: Recorder) -> None:
"""Initialize the table manager.
The table manager is responsible for managing the id mappings
@ -55,7 +57,7 @@ class BaseTableManager[_DataT]:
class BaseLRUTableManager[_DataT](BaseTableManager[_DataT]):
"""Base class for LRU table managers."""
def __init__(self, recorder: "Recorder", lru_size: int) -> None:
def __init__(self, recorder: Recorder, lru_size: int) -> None:
"""Initialize the LRU table manager.
We keep track of the most recently used items

View file

@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.core import HomeAssistant, callback
@ -12,7 +14,7 @@ from .const import DOMAIN
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.exclude_domain(DOMAIN)

View file

@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.const import STATE_OFF, STATE_ON
@ -13,7 +15,7 @@ from .const import DOMAIN, STATE_CLEANING, STATE_ERROR, STATE_RETURNING
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.on_off_states(

View file

@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.const import STATE_OFF, STATE_ON
@ -21,7 +23,7 @@ from .const import (
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.on_off_states(

View file

@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.core import HomeAssistant, callback
@ -12,7 +14,7 @@ from .const import DOMAIN
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.exclude_domain(DOMAIN)

View file

@ -1,5 +1,7 @@
"""Common data structures and helpers for accessing them."""
from __future__ import annotations
from collections.abc import Sequence
from dataclasses import dataclass
from typing import TYPE_CHECKING, cast
@ -19,9 +21,9 @@ if TYPE_CHECKING: # Avoid circular dependencies.
class WemoConfigEntryData:
"""Config entry state data."""
device_coordinators: dict[str, "DeviceCoordinator"]
discovery: "WemoDiscovery"
dispatcher: "WemoDispatcher"
device_coordinators: dict[str, DeviceCoordinator]
discovery: WemoDiscovery
dispatcher: WemoDispatcher
@dataclass
@ -29,7 +31,7 @@ class WemoData:
"""Component state data."""
discovery_enabled: bool
static_config: Sequence["HostPortTuple"]
static_config: Sequence[HostPortTuple]
registry: pywemo.SubscriptionRegistry
# config_entry_data is set when the config entry is loaded and unset when it's
# unloaded. It's a programmer error if config_entry_data is accessed when the