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 functionspull/111041/head
parent
dd51b0c6cc
commit
e398accc3e
|
@ -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."""
|
||||
|
|
Loading…
Reference in New Issue