Skip to content

Commit

Permalink
fix: replace deprecated async_forward_entry_setup method (#141)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
xathon and Alexander Fuchs authored Dec 29, 2024
1 parent 046e674 commit 72ce2a3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions custom_components/battery_sim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 72ce2a3

Please sign in to comment.