1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-26 14:08:21 +00:00

Fix clearing error message for MQTT vacuum (#23206)

* Fix clearing error message

* Remove redundant hass.async_block_till_done
This commit is contained in:
Erik Montnemery
2019-04-19 06:01:19 +02:00
committed by Paulus Schoutsen
parent eac2388d49
commit bea7e2a7fa
2 changed files with 9 additions and 2 deletions

View File

@@ -298,10 +298,17 @@ async def test_status_error(hass, mock_publish):
}"""
async_fire_mqtt_message(hass, 'vacuum/state', message)
await hass.async_block_till_done()
await hass.async_block_till_done()
state = hass.states.get('vacuum.mqtttest')
assert 'Error: Error1' == state.attributes.get(ATTR_STATUS)
message = """{
"error": ""
}"""
async_fire_mqtt_message(hass, 'vacuum/state', message)
await hass.async_block_till_done()
state = hass.states.get('vacuum.mqtttest')
assert 'Stopped' == state.attributes.get(ATTR_STATUS)
async def test_battery_template(hass, mock_publish):
"""Test that you can use non-default templates for battery_level."""