diff --git a/custom_components/alexa_media/config_flow.py b/custom_components/alexa_media/config_flow.py index 194cf4b1..70997c3e 100644 --- a/custom_components/alexa_media/config_flow.py +++ b/custom_components/alexa_media/config_flow.py @@ -871,7 +871,7 @@ class OptionsFlowHandler(config_entries.OptionsFlow): def __init__(self, config_entry: config_entries.ConfigEntry) -> None: """Initialize options flow.""" self.config = OrderedDict() - self.config_entry = config_entry + self._config_entry = config_entry async def async_step_init( self, user_input: dict[str, Any] | None = None @@ -883,7 +883,7 @@ async def async_step_init( ( vol.Optional( CONF_PUBLIC_URL, - default=self.config_entry.data.get( + default=self._config_entry.data.get( CONF_PUBLIC_URL, DEFAULT_PUBLIC_URL ), ), @@ -892,28 +892,28 @@ async def async_step_init( ( vol.Optional( CONF_INCLUDE_DEVICES, - default=self.config_entry.data.get(CONF_INCLUDE_DEVICES, ""), + default=self._config_entry.data.get(CONF_INCLUDE_DEVICES, ""), ), str, ), ( vol.Optional( CONF_EXCLUDE_DEVICES, - default=self.config_entry.data.get(CONF_EXCLUDE_DEVICES, ""), + default=self._config_entry.data.get(CONF_EXCLUDE_DEVICES, ""), ), str, ), ( vol.Optional( CONF_SCAN_INTERVAL, - default=self.config_entry.data.get(CONF_SCAN_INTERVAL, 120), + default=self._config_entry.data.get(CONF_SCAN_INTERVAL, 120), ), int, ), ( vol.Optional( CONF_QUEUE_DELAY, - default=self.config_entry.data.get( + default=self._config_entry.data.get( CONF_QUEUE_DELAY, DEFAULT_QUEUE_DELAY ), ), @@ -922,7 +922,7 @@ async def async_step_init( ( vol.Optional( CONF_EXTENDED_ENTITY_DISCOVERY, - default=self.config_entry.data.get( + default=self._config_entry.data.get( CONF_EXTENDED_ENTITY_DISCOVERY, DEFAULT_EXTENDED_ENTITY_DISCOVERY, ), @@ -932,7 +932,7 @@ async def async_step_init( ( vol.Optional( CONF_DEBUG, - default=self.config_entry.data.get(CONF_DEBUG, DEFAULT_DEBUG), + default=self._config_entry.data.get(CONF_DEBUG, DEFAULT_DEBUG), ), bool, ), @@ -941,27 +941,27 @@ async def async_step_init( if user_input is not None: """Preserve these parameters""" - if CONF_URL in self.config_entry.data: - user_input[CONF_URL] = self.config_entry.data[CONF_URL] - if CONF_EMAIL in self.config_entry.data: - user_input[CONF_EMAIL] = self.config_entry.data[CONF_EMAIL] - if CONF_PASSWORD in self.config_entry.data: - user_input[CONF_PASSWORD] = self.config_entry.data[CONF_PASSWORD] - if CONF_SECURITYCODE in self.config_entry.data: - user_input[CONF_SECURITYCODE] = self.config_entry.data[ + if CONF_URL in self._config_entry.data: + user_input[CONF_URL] = self._config_entry.data[CONF_URL] + if CONF_EMAIL in self._config_entry.data: + user_input[CONF_EMAIL] = self._config_entry.data[CONF_EMAIL] + if CONF_PASSWORD in self._config_entry.data: + user_input[CONF_PASSWORD] = self._config_entry.data[CONF_PASSWORD] + if CONF_SECURITYCODE in self._config_entry.data: + user_input[CONF_SECURITYCODE] = self._config_entry.data[ CONF_SECURITYCODE ] - if CONF_OTPSECRET in self.config_entry.data: - user_input[CONF_OTPSECRET] = self.config_entry.data[CONF_OTPSECRET] - if CONF_OAUTH in self.config_entry.data: - user_input[CONF_OAUTH] = self.config_entry.data[CONF_OAUTH] + if CONF_OTPSECRET in self._config_entry.data: + user_input[CONF_OTPSECRET] = self._config_entry.data[CONF_OTPSECRET] + if CONF_OAUTH in self._config_entry.data: + user_input[CONF_OAUTH] = self._config_entry.data[CONF_OAUTH] """Ensure public_url ends with trailing slash""" - if CONF_PUBLIC_URL in self.config_entry.data: + if CONF_PUBLIC_URL in self._config_entry.data: if not user_input[CONF_PUBLIC_URL].endswith("/"): user_input[CONF_PUBLIC_URL] = user_input[CONF_PUBLIC_URL] + "/" self.hass.config_entries.async_update_entry( - self.config_entry, data=user_input, options=self.config_entry.options + self._config_entry, data=user_input, options=self._config_entry.options ) return self.async_create_entry(title="", data={})