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

@ -57,7 +57,7 @@ async def test_if_fires_on_topic_match(hass, calls):
await hass.async_block_till_done()
async_fire_mqtt_message(hass, "test-topic", "test_payload")
await hass.async_block_till_done()
assert 1 == len(calls)
assert len(calls) == 1
async def test_if_fires_on_topic_and_payload_match(hass, calls):
@ -79,7 +79,7 @@ async def test_if_fires_on_topic_and_payload_match(hass, calls):
async_fire_mqtt_message(hass, "test-topic", "hello")
await hass.async_block_till_done()
assert 1 == len(calls)
assert len(calls) == 1
async def test_if_not_fires_on_topic_but_no_payload_match(hass, calls):
@ -101,7 +101,7 @@ async def test_if_not_fires_on_topic_but_no_payload_match(hass, calls):
async_fire_mqtt_message(hass, "test-topic", "no-hello")
await hass.async_block_till_done()
assert 0 == len(calls)
assert len(calls) == 0
async def test_encoding_default(hass, calls):