Black
This commit is contained in:
parent
da05dfe708
commit
4de97abc3a
2676 changed files with 163166 additions and 140084 deletions
|
@ -9,22 +9,20 @@ from .test_auth import test_auth_via_msg
|
|||
async def test_websocket_api(hass, no_auth_websocket_client, legacy_auth):
|
||||
"""Test API streams."""
|
||||
with assert_setup_component(1):
|
||||
await async_setup_component(hass, 'sensor', {
|
||||
'sensor': {
|
||||
'platform': 'websocket_api',
|
||||
}
|
||||
})
|
||||
await async_setup_component(
|
||||
hass, "sensor", {"sensor": {"platform": "websocket_api"}}
|
||||
)
|
||||
|
||||
state = hass.states.get('sensor.connected_clients')
|
||||
assert state.state == '0'
|
||||
state = hass.states.get("sensor.connected_clients")
|
||||
assert state.state == "0"
|
||||
|
||||
await test_auth_via_msg(no_auth_websocket_client, legacy_auth)
|
||||
|
||||
state = hass.states.get('sensor.connected_clients')
|
||||
assert state.state == '1'
|
||||
state = hass.states.get("sensor.connected_clients")
|
||||
assert state.state == "1"
|
||||
|
||||
await no_auth_websocket_client.close()
|
||||
await hass.async_block_till_done()
|
||||
|
||||
state = hass.states.get('sensor.connected_clients')
|
||||
assert state.state == '0'
|
||||
state = hass.states.get("sensor.connected_clients")
|
||||
assert state.state == "0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue