From 7372cb2551fc2b76fd798e9af1c1a5af2d2832fa Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Sun, 25 Aug 2024 16:35:50 -0700 Subject: [PATCH 1/2] Fix #1020 --- custom_components/adaptive_lighting/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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 From 5152bf86b59959b85b9662a1fa155588a922f670 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Wed, 1 Jan 2025 12:28:23 -0800 Subject: [PATCH 2/2] await hass.async_block_till_done() --- tests/test_config_flow.py | 1 + 1 file changed, 1 insertion(+) 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={},