From 72ce2a389a55cb062a37e0bf90d49c3589b44e77 Mon Sep 17 00:00:00 2001 From: Alex Fuchs <36819668+xathon@users.noreply.github.com> Date: Sun, 29 Dec 2024 21:30:41 +0100 Subject: [PATCH] fix: replace deprecated async_forward_entry_setup method (#141) The new async_forward_entry_setups method accepts the whole BATTERY_PLATFORMS Iterable, so the module doesn't have to do the iteration itself. Co-authored-by: Alexander Fuchs --- custom_components/battery_sim/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/custom_components/battery_sim/__init__.py b/custom_components/battery_sim/__init__.py index 7b6b41f..cc8aacc 100644 --- a/custom_components/battery_sim/__init__.py +++ b/custom_components/battery_sim/__init__.py @@ -133,10 +133,9 @@ async def async_setup_entry(hass, entry) -> bool: hass.data[DOMAIN][entry.entry_id] = handle handle._listeners.append(entry.add_update_listener(async_update_settings)) - for platform in BATTERY_PLATFORMS: - hass.async_create_task( - hass.config_entries.async_forward_entry_setup(entry, platform) - ) + hass.async_create_task( + hass.config_entries.async_forward_entry_setups(entry, BATTERY_PLATFORMS) + ) return True