Skip to content

Commit 276c4cd

Browse files
authored
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/
1 parent b42c822 commit 276c4cd

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

custom_components/openhasp/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,8 @@ async def async_setup_entry(hass, entry) -> bool:
264264
await component.async_add_entities([plate_entity])
265265
hass.data[DOMAIN][CONF_PLATE][plate] = plate_entity
266266

267-
for domain in PLATFORMS:
268-
hass.async_create_task(
269-
hass.config_entries.async_forward_entry_setup(entry, domain)
270-
)
271-
267+
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
268+
272269
listener = entry.add_update_listener(async_update_options)
273270
entry.async_on_unload(listener)
274271

0 commit comments

Comments
 (0)