diff --git a/homeassistant/components/plex/__init__.py b/homeassistant/components/plex/__init__.py index 95fb6e4f09f052..3682f36270054e 100644 --- a/homeassistant/components/plex/__init__.py +++ b/homeassistant/components/plex/__init__.py @@ -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( diff --git a/homeassistant/components/plex/config_flow.py b/homeassistant/components/plex/config_flow.py index b2bf856402e21f..bdbdc9c6cc9ae7 100644 --- a/homeassistant/components/plex/config_flow.py +++ b/homeassistant/components/plex/config_flow.py @@ -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 @@ -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) @@ -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") return await self.async_step_user()