Do async_setup_platform in background (#36244)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
d488c779fc
commit
276f3afb00
161 changed files with 1184 additions and 305 deletions
|
@ -16,6 +16,7 @@ async def websocket_client(hass, hass_ws_client):
|
|||
async def no_auth_websocket_client(hass, aiohttp_client):
|
||||
"""Websocket connection that requires authentication."""
|
||||
assert await async_setup_component(hass, "websocket_api", {})
|
||||
await hass.async_block_till_done()
|
||||
|
||||
client = await aiohttp_client(hass.http.app)
|
||||
ws = await client.ws_connect(URL)
|
||||
|
@ -23,6 +24,7 @@ async def no_auth_websocket_client(hass, aiohttp_client):
|
|||
auth_ok = await ws.receive_json()
|
||||
assert auth_ok["type"] == TYPE_AUTH_REQUIRED
|
||||
|
||||
ws.client = client
|
||||
yield ws
|
||||
|
||||
if not ws.closed:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue