Reduce config entry setup/unload boilerplate N-P (#49777)

This commit is contained in:
J. Nick Koston 2021-04-27 08:42:21 -10:00 committed by GitHub
parent 6df19205da
commit 3f3f77c6e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 90 additions and 389 deletions

View file

@ -1,5 +1,4 @@
"""Support to embed Plex."""
import asyncio
from functools import partial
import logging
@ -232,15 +231,11 @@ async def async_unload_entry(hass, entry):
for unsub in dispatchers:
unsub()
tasks = [
hass.config_entries.async_forward_entry_unload(entry, platform)
for platform in PLATFORMS
]
await asyncio.gather(*tasks)
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
hass.data[PLEX_DOMAIN][SERVERS].pop(server_id)
return True
return unload_ok
async def async_options_updated(hass, entry):