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
pull/111041/head
J. Nick Koston 2024-02-23 04:27:17 -10:00 committed by GitHub
parent dd51b0c6cc
commit e398accc3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -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."""