mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 02:24:51 -05:00
Persist an empty LLM API selection in OpenAI Conversation (#179893)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
26b3d95441
commit
1fb1057c73
@@ -309,7 +309,7 @@ class OpenAISubentryFlowHandler(ConfigSubentryFlow):
|
||||
] = bool
|
||||
|
||||
if user_input is not None:
|
||||
if not user_input.get(CONF_LLM_HASS_API):
|
||||
if user_input.get(CONF_LLM_HASS_API) is None:
|
||||
user_input.pop(CONF_LLM_HASS_API, None)
|
||||
|
||||
if user_input[CONF_RECOMMENDED]:
|
||||
|
||||
@@ -647,6 +647,25 @@ async def test_form_invalid_auth(hass: HomeAssistant, side_effect, error) -> Non
|
||||
@pytest.mark.parametrize(
|
||||
("current_options", "new_options", "expected_options"),
|
||||
[
|
||||
( # Test clearing every llm api is stored as an empty list
|
||||
{
|
||||
CONF_RECOMMENDED: True,
|
||||
CONF_LLM_HASS_API: ["assist"],
|
||||
CONF_PROMPT: "",
|
||||
},
|
||||
(
|
||||
{
|
||||
CONF_RECOMMENDED: True,
|
||||
CONF_LLM_HASS_API: [],
|
||||
CONF_PROMPT: "",
|
||||
},
|
||||
),
|
||||
{
|
||||
CONF_RECOMMENDED: True,
|
||||
CONF_LLM_HASS_API: [],
|
||||
CONF_PROMPT: "",
|
||||
},
|
||||
),
|
||||
( # Test converting single llm api format to list
|
||||
{
|
||||
CONF_RECOMMENDED: True,
|
||||
|
||||
Reference in New Issue
Block a user