From e398accc3e2758080a39261adf07a71b9754676e Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 23 Feb 2024 04:27:17 -1000 Subject: [PATCH] Convert hassio websocket_apis that did not await to normal functions (#111173) * Convert hassio websocket_apis that did not await to normal functions * Convert hassio websocket_apis that did not await to normal functions --- homeassistant/components/hassio/websocket_api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/hassio/websocket_api.py b/homeassistant/components/hassio/websocket_api.py index ae04aa0fff5..cf59f8de7f7 100644 --- a/homeassistant/components/hassio/websocket_api.py +++ b/homeassistant/components/hassio/websocket_api.py @@ -61,10 +61,10 @@ def async_load_websocket_api(hass: HomeAssistant) -> None: websocket_api.async_register_command(hass, websocket_subscribe) +@callback @websocket_api.require_admin @websocket_api.websocket_command({vol.Required(WS_TYPE): WS_TYPE_SUBSCRIBE}) -@websocket_api.async_response -async def websocket_subscribe( +def websocket_subscribe( hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any] ) -> None: """Subscribe to supervisor events.""" @@ -80,14 +80,14 @@ async def websocket_subscribe( connection.send_message(websocket_api.result_message(msg[WS_ID])) +@callback @websocket_api.websocket_command( { vol.Required(WS_TYPE): WS_TYPE_EVENT, vol.Required(ATTR_DATA): SCHEMA_WEBSOCKET_EVENT, } ) -@websocket_api.async_response -async def websocket_supervisor_event( +def websocket_supervisor_event( hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any] ) -> None: """Publish events from the Supervisor."""