Several optimizations to automations (#35007)

This commit is contained in:
Franck Nijhof 2020-05-01 16:37:25 +02:00 committed by GitHub
parent f3d79104a7
commit 8c65062271
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 330 additions and 325 deletions

View file

@ -81,7 +81,7 @@ async def test_if_fires_on_zone_enter(hass, calls):
)
await hass.async_block_till_done()
assert 1 == len(calls)
assert len(calls) == 1
assert calls[0].context.parent_id == context.id
assert "zone - test.entity - hello - hello - test" == calls[0].data["some"]
@ -99,7 +99,7 @@ async def test_if_fires_on_zone_enter(hass, calls):
)
await hass.async_block_till_done()
assert 1 == len(calls)
assert len(calls) == 1
async def test_if_not_fires_for_enter_on_zone_leave(hass, calls):
@ -130,7 +130,7 @@ async def test_if_not_fires_for_enter_on_zone_leave(hass, calls):
)
await hass.async_block_till_done()
assert 0 == len(calls)
assert len(calls) == 0
async def test_if_fires_on_zone_leave(hass, calls):
@ -161,7 +161,7 @@ async def test_if_fires_on_zone_leave(hass, calls):
)
await hass.async_block_till_done()
assert 1 == len(calls)
assert len(calls) == 1
async def test_if_not_fires_for_leave_on_zone_enter(hass, calls):
@ -192,7 +192,7 @@ async def test_if_not_fires_for_leave_on_zone_enter(hass, calls):
)
await hass.async_block_till_done()
assert 0 == len(calls)
assert len(calls) == 0
async def test_zone_condition(hass, calls):
@ -220,4 +220,4 @@ async def test_zone_condition(hass, calls):
hass.bus.async_fire("test_event")
await hass.async_block_till_done()
assert 1 == len(calls)
assert len(calls) == 1