From 276c4cdd4d7d9205af2a747f9c803b705ec1376e Mon Sep 17 00:00:00 2001 From: "Lars R." <5354495+TNTLarsn@users.noreply.github.com> Date: Tue, 6 Aug 2024 08:25:39 +0200 Subject: [PATCH] Replace deprecated async_forward_entry_setup call Calling hass.config_entries.async_forward_entry_setup is deprecated and will be removed in Home Assistant 2025.6. Instead, await hass.config_entries.async_forward_entry_setups as it can load multiple platforms at once and is more efficient since it does not require a separate import executor job for each platform. https://developers.home-assistant.io/blog/2024/06/12/async_forward_entry_setups/ --- custom_components/openhasp/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/custom_components/openhasp/__init__.py b/custom_components/openhasp/__init__.py index 9a62d80..da017c0 100644 --- a/custom_components/openhasp/__init__.py +++ b/custom_components/openhasp/__init__.py @@ -264,11 +264,8 @@ async def async_setup_entry(hass, entry) -> bool: await component.async_add_entities([plate_entity]) hass.data[DOMAIN][CONF_PLATE][plate] = plate_entity - for domain in PLATFORMS: - hass.async_create_task( - hass.config_entries.async_forward_entry_setup(entry, domain) - ) - + await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) + listener = entry.add_update_listener(async_update_options) entry.async_on_unload(listener)