diff --git a/custom_components/adaptive_lighting/__init__.py b/custom_components/adaptive_lighting/__init__.py index a235d70f..c466017d 100644 --- a/custom_components/adaptive_lighting/__init__.py +++ b/custom_components/adaptive_lighting/__init__.py @@ -65,11 +65,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry): undo_listener = config_entry.add_update_listener(async_update_options) data[config_entry.entry_id] = {UNDO_UPDATE_LISTENER: undo_listener} - for platform in PLATFORMS: - hass.async_create_task( - hass.config_entries.async_forward_entry_setup(config_entry, platform), - ) - + await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS) return True diff --git a/tests/test_config_flow.py b/tests/test_config_flow.py index 1a9e8fbf..fdf17da0 100644 --- a/tests/test_config_flow.py +++ b/tests/test_config_flow.py @@ -128,6 +128,7 @@ async def test_changing_options_when_using_yaml(hass): await hass.config_entries.async_setup(entry.entry_id) result = await hass.config_entries.options.async_init(entry.entry_id) + await hass.async_block_till_done() result = await hass.config_entries.options.async_configure( result["flow_id"], user_input={},