From b69249850f969bc87e1b0cb178958611d4100835 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 18 Jun 2024 18:41:04 +0200 Subject: [PATCH 1/2] 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 From 48c0817f7744c70cffc3d5ad5a55e558ffbe29ad Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 26 Jun 2024 21:11:25 +0200 Subject: [PATCH 2/2] bugfix --- custom_components/dwd_weather/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/dwd_weather/__init__.py b/custom_components/dwd_weather/__init__.py index 2dffc90..363a8a5 100644 --- a/custom_components/dwd_weather/__init__.py +++ b/custom_components/dwd_weather/__init__.py @@ -101,7 +101,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): DWDWEATHER_COORDINATOR: dwdweather_coordinator, } - await hass.config_entries.async_forward_entry_setups(entry, "camera") + await hass.config_entries.async_forward_entry_setups(entry, ["camera"]) return True