Remove useless TypeVars (#117687)

pull/117691/head
Marc Mueller 2024-05-18 12:58:51 +02:00 committed by GitHub
parent 97a4101900
commit 10dfa91e54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 6 deletions

View File

@ -6,7 +6,7 @@ import asyncio
from collections.abc import Awaitable, Callable
import functools
import logging
from typing import TYPE_CHECKING, Any, Final, TypeVar
from typing import TYPE_CHECKING, Any, Final
from homeassistant.const import Platform
from homeassistant.core import callback
@ -29,7 +29,6 @@ ATTR_IN_CLUSTERS: Final[str] = "input_clusters"
ATTR_OUT_CLUSTERS: Final[str] = "output_clusters"
_LOGGER = logging.getLogger(__name__)
CALLABLE_T = TypeVar("CALLABLE_T", bound=Callable)
class Endpoint:
@ -209,7 +208,7 @@ class Endpoint:
def async_new_entity(
self,
platform: Platform,
entity_class: CALLABLE_T,
entity_class: type,
unique_id: str,
cluster_handlers: list[ClusterHandler],
**kwargs: Any,

View File

@ -583,7 +583,7 @@ def slug(value: Any) -> str:
def schema_with_slug_keys(
value_schema: _T | Callable, *, slug_validator: Callable[[Any], str] = slug
value_schema: dict | Callable, *, slug_validator: Callable[[Any], str] = slug
) -> Callable:
"""Ensure dicts have slugs as keys.

View File

@ -17,7 +17,6 @@ from homeassistant.components.bluetooth import (
BluetoothServiceInfoBleak,
)
from homeassistant.components.bluetooth.active_update_coordinator import (
_T,
ActiveBluetoothDataUpdateCoordinator,
)
from homeassistant.core import CoreState, HomeAssistant
@ -68,7 +67,7 @@ class MyCoordinator(ActiveBluetoothDataUpdateCoordinator[dict[str, Any]]):
needs_poll_method: Callable[[BluetoothServiceInfoBleak, float | None], bool],
poll_method: Callable[
[BluetoothServiceInfoBleak],
Coroutine[Any, Any, _T],
Coroutine[Any, Any, dict[str, Any]],
]
| None = None,
poll_debouncer: Debouncer[Coroutine[Any, Any, None]] | None = None,