Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deprecated async_forward_entry_setup #1174

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading