Do async_setup_platform in background (#36244)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Paulus Schoutsen 2020-05-31 22:18:30 -07:00 committed by GitHub
parent d488c779fc
commit 276f3afb00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
161 changed files with 1184 additions and 305 deletions

View file

@ -64,6 +64,7 @@ async def test_setting_sensor_value_via_mqtt_message(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
async_fire_mqtt_message(hass, "test-topic", "100")
state = hass.states.get("sensor.test")
@ -88,6 +89,7 @@ async def test_setting_sensor_value_expires(hass, mqtt_mock, caplog):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("sensor.test")
assert state.state == "unknown"
@ -155,6 +157,7 @@ async def test_setting_sensor_value_via_mqtt_json_message(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
async_fire_mqtt_message(hass, "test-topic", '{ "val": "100" }')
state = hass.states.get("sensor.test")
@ -176,6 +179,7 @@ async def test_force_update_disabled(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
events = []
@ -209,6 +213,7 @@ async def test_force_update_enabled(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
events = []
@ -262,6 +267,7 @@ async def test_invalid_device_class(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("sensor.test")
assert state is None