Use PEP 695 for simple type aliases (#117633)

This commit is contained in:
Marc Mueller 2024-05-17 14:42:21 +02:00 committed by GitHub
parent 4edee94a81
commit 87bb7ced79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
78 changed files with 139 additions and 140 deletions

View file

@ -26,8 +26,8 @@ current_connection = ContextVar["ActiveConnection | None"](
"current_connection", default=None
)
MessageHandler = Callable[[HomeAssistant, "ActiveConnection", dict[str, Any]], None]
BinaryHandler = Callable[[HomeAssistant, "ActiveConnection", bytes], None]
type MessageHandler = Callable[[HomeAssistant, ActiveConnection, dict[str, Any]], None]
type BinaryHandler = Callable[[HomeAssistant, ActiveConnection, bytes], None]
class ActiveConnection:

View file

@ -11,11 +11,11 @@ if TYPE_CHECKING:
from .connection import ActiveConnection
WebSocketCommandHandler = Callable[
[HomeAssistant, "ActiveConnection", dict[str, Any]], None
type WebSocketCommandHandler = Callable[
[HomeAssistant, ActiveConnection, dict[str, Any]], None
]
AsyncWebSocketCommandHandler = Callable[
[HomeAssistant, "ActiveConnection", dict[str, Any]], Awaitable[None]
type AsyncWebSocketCommandHandler = Callable[
[HomeAssistant, ActiveConnection, dict[str, Any]], Awaitable[None]
]
DOMAIN: Final = "websocket_api"