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)
|
websocket_api.async_register_command(hass, websocket_subscribe)
|
||||||
|
|
||||||
|
|
||||||
|
@callback
|
||||||
@websocket_api.require_admin
|
@websocket_api.require_admin
|
||||||
@websocket_api.websocket_command({vol.Required(WS_TYPE): WS_TYPE_SUBSCRIBE})
|
@websocket_api.websocket_command({vol.Required(WS_TYPE): WS_TYPE_SUBSCRIBE})
|
||||||
@websocket_api.async_response
|
def websocket_subscribe(
|
||||||
async def websocket_subscribe(
|
|
||||||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Subscribe to supervisor events."""
|
"""Subscribe to supervisor events."""
|
||||||
|
@ -80,14 +80,14 @@ async def websocket_subscribe(
|
||||||
connection.send_message(websocket_api.result_message(msg[WS_ID]))
|
connection.send_message(websocket_api.result_message(msg[WS_ID]))
|
||||||
|
|
||||||
|
|
||||||
|
@callback
|
||||||
@websocket_api.websocket_command(
|
@websocket_api.websocket_command(
|
||||||
{
|
{
|
||||||
vol.Required(WS_TYPE): WS_TYPE_EVENT,
|
vol.Required(WS_TYPE): WS_TYPE_EVENT,
|
||||||
vol.Required(ATTR_DATA): SCHEMA_WEBSOCKET_EVENT,
|
vol.Required(ATTR_DATA): SCHEMA_WEBSOCKET_EVENT,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@websocket_api.async_response
|
def websocket_supervisor_event(
|
||||||
async def websocket_supervisor_event(
|
|
||||||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Publish events from the Supervisor."""
|
"""Publish events from the Supervisor."""
|
||||||
|
|
Loading…
Reference in New Issue