diff --git a/custom_components/mass/config_flow.py b/custom_components/mass/config_flow.py index 17a75e93..bec29aa2 100644 --- a/custom_components/mass/config_flow.py +++ b/custom_components/mass/config_flow.py @@ -390,21 +390,18 @@ def __init__(self, config_entry: config_entries.ConfigEntry) -> None: async def async_step_init(self, user_input=None) -> FlowResult: """Manage the options.""" - LOGGER.debug( - "OptionsFlowHandler:async_step_init user_input [%s] data [%s]", - user_input, - self.config_entry.data, - ) if user_input is not None: - if CONF_USE_ADDON in self.config_entry.data: - user_input[CONF_USE_ADDON] = self.config_entry.data[CONF_USE_ADDON] - if CONF_INTEGRATION_CREATED_ADDON in self.config_entry.data: - user_input[CONF_INTEGRATION_CREATED_ADDON] = self.config_entry.data[ - CONF_INTEGRATION_CREATED_ADDON - ] - self.hass.config_entries.async_update_entry( - self.config_entry, data=user_input, options=self.config_entry.options + self.config_entry, + # store as data instead of options - adjust this once the reconfigure flow is available + data={ + CONF_URL: user_input[CONF_URL], + CONF_OPENAI_AGENT_ID: user_input[CONF_OPENAI_AGENT_ID], + CONF_ASSIST_AUTO_EXPOSE_PLAYERS: user_input[ + CONF_ASSIST_AUTO_EXPOSE_PLAYERS + ], + CONF_PRE_ANNOUNCE_TTS: user_input[CONF_PRE_ANNOUNCE_TTS], + }, ) await self.hass.config_entries.async_reload(self.config_entry.entry_id) return self.async_create_entry(title="", data={}) @@ -441,7 +438,7 @@ def mass_config_option_schema( ): bool, vol.Optional( CONF_PRE_ANNOUNCE_TTS, - default=False, + default=config_entry.data.get(CONF_PRE_ANNOUNCE_TTS, False), ): bool, } diff --git a/custom_components/mass/media_player.py b/custom_components/mass/media_player.py index 7b56a28e..ca13c0d5 100644 --- a/custom_components/mass/media_player.py +++ b/custom_components/mass/media_player.py @@ -477,7 +477,7 @@ async def _async_play_media_advanced( conf_entry = self.hass.config_entries.async_get_entry( self.registry_entry.config_entry_id ) - use_pre_announce = conf_entry.options.get(CONF_PRE_ANNOUNCE_TTS) is True + use_pre_announce = conf_entry.data.get(CONF_PRE_ANNOUNCE_TTS) is True await self.mass.players.play_announcement( self.player_id, media_id[0], use_pre_announce )