From 5f7c6341623781bcd23c6e51b21dd4eda87777eb Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Mon, 25 Aug 2025 11:16:18 -0500 Subject: [PATCH] Remove country argument --- homeassistant/components/conversation/http.py | 4 +-- tests/components/conversation/test_http.py | 29 ------------------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/homeassistant/components/conversation/http.py b/homeassistant/components/conversation/http.py index f3370185a7a..620f36588fc 100644 --- a/homeassistant/components/conversation/http.py +++ b/homeassistant/components/conversation/http.py @@ -357,7 +357,6 @@ def _get_unmatched_slots( { vol.Required("type"): "conversation/agent/homeassistant/language_scores", vol.Optional("language"): str, - vol.Optional("country"): str, } ) @websocket_api.async_response @@ -368,10 +367,9 @@ async def websocket_hass_agent_language_scores( ) -> None: """Get support scores per language.""" language = msg.get("language", hass.config.language) - country = msg.get("country", hass.config.country) scores = await hass.async_add_executor_job(get_language_scores) - matching_langs = language_util.matches(language, scores.keys(), country=country) + matching_langs = language_util.matches(language, scores.keys()) preferred_lang = matching_langs[0] if matching_langs else language result = { "languages": { diff --git a/tests/components/conversation/test_http.py b/tests/components/conversation/test_http.py index fac58f07bd2..e825eb96b95 100644 --- a/tests/components/conversation/test_http.py +++ b/tests/components/conversation/test_http.py @@ -646,35 +646,6 @@ async def test_ws_hass_agent_custom_sentences( custom_sentences = msg["result"] assert custom_sentences.keys() == {"nl"} - # British English is first - await client.send_json_auto_id( - { - "type": "conversation/agent/homeassistant/custom_sentences", - "language": "en", - "country": "GB", - } - ) - msg = await client.receive_json() - - assert msg["success"] - assert msg["result"] == snapshot - custom_sentences = msg["result"] - assert list(custom_sentences.keys()) == ["en-GB", "en"] - - # General English is first - await client.send_json_auto_id( - { - "type": "conversation/agent/homeassistant/custom_sentences", - "language": "en", - } - ) - msg = await client.receive_json() - - assert msg["success"] - assert msg["result"] == snapshot - custom_sentences = msg["result"] - assert list(custom_sentences.keys()) == ["en", "en-GB"] - def _load_custom_sentences(hass: HomeAssistant) -> dict[str, dict[str, Any]]: """Loads custom sentences from testing_config/custom_sentences."""