Only drop the LLM API key when it was not submitted

Keep the recommended value as the fallback for a subentry with no
llm_hass_api key, and only remove the key when it is absent from the
submitted input, so an empty selection is stored and read back as empty.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016D21QGmGduj7t1aQLX26pS
This commit is contained in:
Claude
2026-08-21 20:47:46 +00:00
parent 573e22cd5f
commit b34315f0aa
@@ -146,6 +146,8 @@ class ConversationFlowHandler(OpenRouterSubentryFlowHandler):
return self.async_abort(reason="entry_not_loaded")
if user_input is not None:
if user_input.get(CONF_LLM_HASS_API) is None:
user_input.pop(CONF_LLM_HASS_API, None)
if self._is_new:
return self.async_create_entry(
title=self.models[user_input[CONF_MODEL]].name, data=user_input