Remove country argument

This commit is contained in:
Michael Hansen
2025-08-25 11:16:18 -05:00
parent 9c9aa23e62
commit 5f7c634162
2 changed files with 1 additions and 32 deletions

View File

@@ -357,7 +357,6 @@ def _get_unmatched_slots(
{ {
vol.Required("type"): "conversation/agent/homeassistant/language_scores", vol.Required("type"): "conversation/agent/homeassistant/language_scores",
vol.Optional("language"): str, vol.Optional("language"): str,
vol.Optional("country"): str,
} }
) )
@websocket_api.async_response @websocket_api.async_response
@@ -368,10 +367,9 @@ async def websocket_hass_agent_language_scores(
) -> None: ) -> None:
"""Get support scores per language.""" """Get support scores per language."""
language = msg.get("language", hass.config.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) 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 preferred_lang = matching_langs[0] if matching_langs else language
result = { result = {
"languages": { "languages": {

View File

@@ -646,35 +646,6 @@ async def test_ws_hass_agent_custom_sentences(
custom_sentences = msg["result"] custom_sentences = msg["result"]
assert custom_sentences.keys() == {"nl"} 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]]: def _load_custom_sentences(hass: HomeAssistant) -> dict[str, dict[str, Any]]:
"""Loads custom sentences from testing_config/custom_sentences.""" """Loads custom sentences from testing_config/custom_sentences."""