Use PEP 695 for function annotations (2) (#117659)

This commit is contained in:
Marc Mueller 2024-05-18 11:44:39 +02:00 committed by GitHub
parent 4cf0a3f154
commit 900b6211ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 30 additions and 73 deletions

View file

@ -16,16 +16,7 @@ from operator import attrgetter
import sys
import time
from types import FunctionType
from typing import (
TYPE_CHECKING,
Any,
Final,
Literal,
NotRequired,
TypedDict,
TypeVar,
final,
)
from typing import TYPE_CHECKING, Any, Final, Literal, NotRequired, TypedDict, final
import voluptuous as vol
@ -79,8 +70,6 @@ timer = time.time
if TYPE_CHECKING:
from .entity_platform import EntityPlatform
_T = TypeVar("_T")
_LOGGER = logging.getLogger(__name__)
SLOW_UPDATE_WARNING = 10
DATA_ENTITY_SOURCE = "entity_info"
@ -1603,7 +1592,7 @@ class Entity(
return f"<entity unknown.unknown={STATE_UNKNOWN}>"
return f"<entity {self.entity_id}={self._stringify_state(self.available)}>"
async def async_request_call(self, coro: Coroutine[Any, Any, _T]) -> _T:
async def async_request_call[_T](self, coro: Coroutine[Any, Any, _T]) -> _T:
"""Process request batched."""
if self.parallel_updates:
await self.parallel_updates.acquire()