From b69249850f969bc87e1b0cb178958611d4100835 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 18 Jun 2024 18:41:04 +0200 Subject: [PATCH] Forwarding setup to config entry platforms --- custom_components/dwd_weather/__init__.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/custom_components/dwd_weather/__init__.py b/custom_components/dwd_weather/__init__.py index 00749e8..2dffc90 100644 --- a/custom_components/dwd_weather/__init__.py +++ b/custom_components/dwd_weather/__init__.py @@ -81,9 +81,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): # Setup weather and sensor platforms for component in PLATFORMS: - hass.async_create_task( - hass.config_entries.async_forward_entry_setup(entry, component) - ) + await hass.config_entries.async_forward_entry_setups(entry, [component]) + elif entry.data[CONF_ENTITY_TYPE] == CONF_ENTITY_TYPE_MAP: dwd_weather_data = DWDMapData(hass, entry) @@ -102,9 +101,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): DWDWEATHER_COORDINATOR: dwdweather_coordinator, } - hass.async_create_task( - hass.config_entries.async_forward_entry_setup(entry, "camera") - ) + await hass.config_entries.async_forward_entry_setups(entry, "camera") return True