Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion homeassistant/components/plex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ async def async_setup_entry(hass, entry):
hass.config_entries.flow.async_init(
PLEX_DOMAIN,
context={CONF_SOURCE: SOURCE_REAUTH},
data={**entry.data, "config_entry_id": entry.entry_id},
data=entry.data,
)
)
_LOGGER.error(
Expand Down
5 changes: 1 addition & 4 deletions homeassistant/components/plex/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def __init__(self):
self.token = None
self.client_id = None
self._manual = False
self._entry_id = None

async def async_step_user(
self, user_input=None, errors=None
Expand Down Expand Up @@ -230,12 +229,11 @@ async def async_step_server_validate(self, server_config):
PLEX_SERVER_CONFIG: entry_config,
}

await self.async_set_unique_id(server_id)
entry = await self.async_set_unique_id(server_id)
if (
self.context[CONF_SOURCE] # pylint: disable=no-member
== config_entries.SOURCE_REAUTH
):
entry = self.hass.config_entries.async_get_entry(self._entry_id)
self.hass.config_entries.async_update_entry(entry, data=data)
_LOGGER.debug("Updated config entry for %s", plex_server.friendly_name)
await self.hass.config_entries.async_reload(entry.entry_id)
Expand Down Expand Up @@ -329,7 +327,6 @@ async def async_step_use_external_token(self, user_input=None):
async def async_step_reauth(self, data):
"""Handle a reauthorization flow request."""
self.current_login = dict(data)
self._entry_id = self.current_login.pop("config_entry_id")
Comment thread
jjlawren marked this conversation as resolved.
return await self.async_step_user()


Expand Down