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

Unload Plex config entries #26771

Merged
merged 3 commits into from Sep 22, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions homeassistant/components/plex/__init__.py
@@ -1,4 +1,5 @@
"""Support to embed Plex."""
import asyncio
import logging

import plexapi.exceptions
Expand Down Expand Up @@ -140,10 +141,13 @@ async def async_unload_entry(hass, entry):
cancel = hass.data[PLEX_DOMAIN][REFRESH_LISTENERS].pop(server_id)
await hass.async_add_executor_job(cancel)

for platform in PLATFORMS:
hass.async_create_task(
tasks = [
asyncio.ensure_future(
MartinHjelmare marked this conversation as resolved.
Show resolved Hide resolved
hass.config_entries.async_forward_entry_unload(entry, platform)
jjlawren marked this conversation as resolved.
Show resolved Hide resolved
)
for platform in PLATFORMS
]
await asyncio.gather(*tasks)

hass.data[PLEX_DOMAIN][SERVERS].pop(server_id)

Expand Down