Fix missing options in Plex config entry (#36683)
This commit is contained in:
1 parent
21acdbbbfd
commit
d4d233536f
2 files changed
+56
No files matched your search
@@ -9,6 +9,7 @@ from plexwebsocket import PlexWebsocket
|
||||
import requests.exceptions
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.media_player import DOMAIN as MP_DOMAIN
|
||||
from homeassistant.components.media_player.const import (
|
||||
ATTR_MEDIA_CONTENT_ID,
|
||||
ATTR_MEDIA_CONTENT_TYPE,
|
||||
@@ -65,6 +66,11 @@ async def async_setup_entry(hass, entry):
|
||||
entry, unique_id=entry.data[CONF_SERVER_IDENTIFIER]
|
||||
)
|
||||
|
||||
if MP_DOMAIN not in entry.options:
|
||||
options = dict(entry.options)
|
||||
options.setdefault(MP_DOMAIN, {})
|
||||
hass.config_entries.async_update_entry(entry, options=options)
|
||||
|
||||
plex_server = PlexServer(
|
||||
hass, server_config, entry.data[CONF_SERVER_IDENTIFIER], entry.options
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user