Skip to content

Commit

Permalink
fix: migrate to async_forward_entry_setup
Browse files Browse the repository at this point in the history
Platforms initialisation via `async_setup_platforms` is deprecated
  • Loading branch information
IATkachenko committed Apr 3, 2023
1 parent d26bf77 commit 4bf6c48
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions custom_components/ha_tion_btle/__init__.py
Expand Up @@ -42,8 +42,11 @@ async def async_setup_entry(hass, config_entry: ConfigEntry):
)

await hass.data[DOMAIN][config_entry.unique_id].async_config_entry_first_refresh()
hass.config_entries.async_setup_platforms(config_entry, PLATFORMS)
return True

result = True
for platform in PLATFORMS:
result = result & await hass.config_entries.async_forward_entry_setup(entry=config_entry, domain=platform)
return result


class TionInstance(DataUpdateCoordinator):
Expand Down

0 comments on commit 4bf6c48

Please sign in to comment.