Improve msg type hint in websocket commands (#80530)

This commit is contained in:
epenet 2022-10-18 16:41:17 +02:00 committed by GitHub
parent 76bd8c431b
commit 5442d6af01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 128 additions and 104 deletions

View file

@ -4,6 +4,7 @@ from __future__ import annotations
import contextlib
from dataclasses import asdict, dataclass
from datetime import datetime, timedelta
from typing import Any
import psutil_home_assistant as ha_psutil
import voluptuous as vol
@ -46,7 +47,7 @@ async def async_setup(hass: HomeAssistant) -> None:
)
@websocket_api.async_response
async def ws_info(
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
) -> None:
"""Return hardware info."""
hardware_info = []
@ -72,7 +73,7 @@ async def ws_info(
)
@websocket_api.async_response
async def ws_subscribe_system_status(
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
):
"""Subscribe to system status updates."""