From e70ba3361715c7719142e66943ce03d4a4f89640 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Thu, 29 Oct 2026 17:45:03 +0100 Subject: [PATCH] Show the AI tools field as a checkbox list (#189320) --- homeassistant/components/anthropic/config_flow.py | 8 +++++++- .../google_generative_ai_conversation/config_flow.py | 4 +++- homeassistant/components/litellm/config_flow.py | 6 +++++- homeassistant/components/llama_cpp/config_flow.py | 6 +++++- homeassistant/components/mcp_server/config_flow.py | 2 ++ homeassistant/components/ollama/config_flow.py | 2 ++ homeassistant/components/open_router/config_flow.py | 6 +++++- .../components/openai_conversation/config_flow.py | 6 +++++- .../components/ovhcloud_ai_endpoints/config_flow.py | 12 ++++++++++-- 9 files changed, 44 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/anthropic/config_flow.py b/homeassistant/components/anthropic/config_flow.py index c56d33dedd5f..4d4fb2783bbb 100644 --- a/homeassistant/components/anthropic/config_flow.py +++ b/homeassistant/components/anthropic/config_flow.py @@ -286,7 +286,13 @@ class ConversationSubentryFlowHandler(ConfigSubentryFlow): probatio.Optional(CONF_PROMPT): TemplateSelector(), probatio.Optional( CONF_LLM_HASS_API, - ): SelectSelector({"options": hass_apis, "multiple": True}), + ): SelectSelector( + { + "options": hass_apis, + "multiple": True, + "mode": SelectSelectorMode.LIST, + } + ), } ) diff --git a/homeassistant/components/google_generative_ai_conversation/config_flow.py b/homeassistant/components/google_generative_ai_conversation/config_flow.py index e673f239b8ba..8dacba9b7e3d 100644 --- a/homeassistant/components/google_generative_ai_conversation/config_flow.py +++ b/homeassistant/components/google_generative_ai_conversation/config_flow.py @@ -341,7 +341,9 @@ async def google_generative_ai_config_option_schema( CONF_LLM_HASS_API, description={"suggested_value": suggested_llm_apis}, ): SelectSelector( - SelectSelectorConfig(options=hass_apis, multiple=True) + SelectSelectorConfig( + options=hass_apis, multiple=True, mode=SelectSelectorMode.LIST + ) ), } ) diff --git a/homeassistant/components/litellm/config_flow.py b/homeassistant/components/litellm/config_flow.py index 6596de9eb3e0..76d306927848 100644 --- a/homeassistant/components/litellm/config_flow.py +++ b/homeassistant/components/litellm/config_flow.py @@ -305,7 +305,11 @@ class ConversationFlowHandler(LiteLLMSubentryFlowHandler): RECOMMENDED_CONVERSATION_OPTIONS[CONF_LLM_HASS_API], ), ): SelectSelector( - SelectSelectorConfig(options=hass_apis, multiple=True) + SelectSelectorConfig( + options=hass_apis, + multiple=True, + mode=SelectSelectorMode.LIST, + ) ), } ), diff --git a/homeassistant/components/llama_cpp/config_flow.py b/homeassistant/components/llama_cpp/config_flow.py index 77d21bfca5f6..4c3ea4b9c7aa 100644 --- a/homeassistant/components/llama_cpp/config_flow.py +++ b/homeassistant/components/llama_cpp/config_flow.py @@ -369,7 +369,11 @@ def llama_cpp_config_option_schema( ): TemplateSelector(), probatio.Optional( CONF_LLM_HASS_API, - ): SelectSelector(SelectSelectorConfig(options=hass_apis, multiple=True)), + ): SelectSelector( + SelectSelectorConfig( + options=hass_apis, multiple=True, mode=SelectSelectorMode.LIST + ) + ), } ) schema.update( diff --git a/homeassistant/components/mcp_server/config_flow.py b/homeassistant/components/mcp_server/config_flow.py index 676dccaee5ce..8ba08d1fbd69 100644 --- a/homeassistant/components/mcp_server/config_flow.py +++ b/homeassistant/components/mcp_server/config_flow.py @@ -20,6 +20,7 @@ from homeassistant.helpers.selector import ( SelectOptionDict, SelectSelector, SelectSelectorConfig, + SelectSelectorMode, ) from .const import CONF_ALL_LLM_APIS, CONF_READ_ONLY, CONF_REQUIRE_ADMIN, DOMAIN @@ -76,6 +77,7 @@ def _options_schema( for llm_api_id, name in llm_apis.items() ], multiple=True, + mode=SelectSelectorMode.LIST, ) ), } diff --git a/homeassistant/components/ollama/config_flow.py b/homeassistant/components/ollama/config_flow.py index 3f4ba04e2732..69a1bae064ee 100644 --- a/homeassistant/components/ollama/config_flow.py +++ b/homeassistant/components/ollama/config_flow.py @@ -36,6 +36,7 @@ from homeassistant.helpers.selector import ( SelectOptionDict, SelectSelector, SelectSelectorConfig, + SelectSelectorMode, TemplateSelector, TextSelector, TextSelectorConfig, @@ -470,6 +471,7 @@ def ollama_config_option_schema( for api in llm.async_get_apis(hass) ], multiple=True, + mode=SelectSelectorMode.LIST, ) ), } diff --git a/homeassistant/components/open_router/config_flow.py b/homeassistant/components/open_router/config_flow.py index 9b1bfdd417df..a0cc03226058 100644 --- a/homeassistant/components/open_router/config_flow.py +++ b/homeassistant/components/open_router/config_flow.py @@ -212,7 +212,11 @@ class ConversationFlowHandler(OpenRouterSubentryFlowHandler): RECOMMENDED_CONVERSATION_OPTIONS[CONF_LLM_HASS_API], ), ): SelectSelector( - SelectSelectorConfig(options=hass_apis, multiple=True) + SelectSelectorConfig( + options=hass_apis, + multiple=True, + mode=SelectSelectorMode.LIST, + ) ), probatio.Optional( CONF_WEB_SEARCH, diff --git a/homeassistant/components/openai_conversation/config_flow.py b/homeassistant/components/openai_conversation/config_flow.py index daa57f9b4e13..d020e0a1d1aa 100644 --- a/homeassistant/components/openai_conversation/config_flow.py +++ b/homeassistant/components/openai_conversation/config_flow.py @@ -328,7 +328,11 @@ class OpenAISubentryFlowHandler(ConfigSubentryFlow): }, ): TemplateSelector(), probatio.Optional(CONF_LLM_HASS_API): SelectSelector( - SelectSelectorConfig(options=hass_apis, multiple=True) + SelectSelectorConfig( + options=hass_apis, + multiple=True, + mode=SelectSelectorMode.LIST, + ) ), } ) diff --git a/homeassistant/components/ovhcloud_ai_endpoints/config_flow.py b/homeassistant/components/ovhcloud_ai_endpoints/config_flow.py index 2ba06e928079..948c0d54a678 100644 --- a/homeassistant/components/ovhcloud_ai_endpoints/config_flow.py +++ b/homeassistant/components/ovhcloud_ai_endpoints/config_flow.py @@ -214,7 +214,11 @@ class ConversationFlowHandler(ConfigSubentryFlow): CONF_LLM_HASS_API, default=selected_apis, ): SelectSelector( - SelectSelectorConfig(options=hass_apis, multiple=True) + SelectSelectorConfig( + options=hass_apis, + multiple=True, + mode=SelectSelectorMode.LIST, + ) ), } ), @@ -281,7 +285,11 @@ class ConversationFlowHandler(ConfigSubentryFlow): RECOMMENDED_CONVERSATION_OPTIONS[CONF_LLM_HASS_API], ), ): SelectSelector( - SelectSelectorConfig(options=hass_apis, multiple=True) + SelectSelectorConfig( + options=hass_apis, + multiple=True, + mode=SelectSelectorMode.LIST, + ) ), } ),