Clean up MQTT platform entry setup at discovery (#72371)
* Setup MQTT discovery with entry setup * Wait for entry setup in test * flake
This commit is contained in:
parent
f846cd033f
commit
48e3d68b53
3 changed files with 25 additions and 44 deletions
|
@ -1780,13 +1780,12 @@ async def test_setup_entry_with_config_override(
|
|||
# mqtt present in yaml config
|
||||
assert await async_setup_component(hass, mqtt.DOMAIN, {})
|
||||
await hass.async_block_till_done()
|
||||
await mqtt_mock_entry_with_yaml_config()
|
||||
|
||||
# User sets up a config entry
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN, data={mqtt.CONF_BROKER: "test-broker"})
|
||||
entry.add_to_hass(hass)
|
||||
with patch("homeassistant.components.mqtt.PLATFORMS", []):
|
||||
assert await hass.config_entries.async_setup(entry.entry_id)
|
||||
assert await hass.config_entries.async_setup(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
# Discover a device to verify the entry was setup correctly
|
||||
async_fire_mqtt_message(hass, "homeassistant/sensor/bla/config", data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue