Skip to content

Commit

Permalink
Fix deprecated async_forward_entry_setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Snuffy2 committed Jul 10, 2024
1 parent 8d1cc2c commit 407bc5b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions custom_components/eufy_security/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry):
coordinator = hass.data[DOMAIN][COORDINATOR] = hass.data[DOMAIN].get(COORDINATOR, EufySecurityDataUpdateCoordinator(hass, config_entry))

await coordinator.initialize()
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
for platform in PLATFORMS:
coordinator.platforms.append(platform.value)
config_entry.async_create_task(hass, hass.config_entries.async_forward_entry_setup(config_entry, platform.value))

async def update(event_time_utc):
local_coordinator = hass.data[DOMAIN][COORDINATOR]
Expand All @@ -66,11 +66,7 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
"""unload active entities"""
_LOGGER.debug(f"async_unload_entry 1")
coordinator = hass.data[DOMAIN][COORDINATOR]
unloaded = all(
await asyncio.gather(
*[hass.config_entries.async_forward_entry_unload(config_entry, platform) for platform in coordinator.platforms]
)
)
unloaded = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

if unloaded:
await coordinator.disconnect()
Expand Down

0 comments on commit 407bc5b

Please sign in to comment.