diff --git a/homeassistant/components/cloud/http_api.py b/homeassistant/components/cloud/http_api.py index 6f18cc424cd..9226110bca2 100644 --- a/homeassistant/components/cloud/http_api.py +++ b/homeassistant/components/cloud/http_api.py @@ -18,7 +18,7 @@ from aiohttp import web import attr from hass_nabucasa import AlreadyConnectedError, Cloud, auth, thingtalk from hass_nabucasa.const import STATE_DISCONNECTED -from hass_nabucasa.voice import TTS_VOICES +from hass_nabucasa.voice_data import TTS_VOICES import voluptuous as vol from homeassistant.components import websocket_api diff --git a/homeassistant/components/cloud/manifest.json b/homeassistant/components/cloud/manifest.json index 7f448f2f614..30e3925a591 100644 --- a/homeassistant/components/cloud/manifest.json +++ b/homeassistant/components/cloud/manifest.json @@ -13,6 +13,6 @@ "integration_type": "system", "iot_class": "cloud_push", "loggers": ["acme", "hass_nabucasa", "snitun"], - "requirements": ["hass-nabucasa==0.94.0"], + "requirements": ["hass-nabucasa==0.96.0"], "single_config_entry": true } diff --git a/homeassistant/components/cloud/tts.py b/homeassistant/components/cloud/tts.py index f901adfa99e..b5e4dc1cd84 100644 --- a/homeassistant/components/cloud/tts.py +++ b/homeassistant/components/cloud/tts.py @@ -6,7 +6,8 @@ import logging from typing import Any from hass_nabucasa import Cloud -from hass_nabucasa.voice import MAP_VOICE, TTS_VOICES, AudioOutput, Gender, VoiceError +from hass_nabucasa.voice import MAP_VOICE, AudioOutput, Gender, VoiceError +from hass_nabucasa.voice_data import TTS_VOICES import voluptuous as vol from homeassistant.components.tts import ( @@ -57,6 +58,7 @@ DEFAULT_VOICES = { "ar-SY": "AmanyNeural", "ar-TN": "ReemNeural", "ar-YE": "MaryamNeural", + "as-IN": "PriyomNeural", "az-AZ": "BabekNeural", "bg-BG": "KalinaNeural", "bn-BD": "NabanitaNeural", @@ -126,6 +128,8 @@ DEFAULT_VOICES = { "id-ID": "GadisNeural", "is-IS": "GudrunNeural", "it-IT": "ElsaNeural", + "iu-Cans-CA": "SiqiniqNeural", + "iu-Latn-CA": "SiqiniqNeural", "ja-JP": "NanamiNeural", "jv-ID": "SitiNeural", "ka-GE": "EkaNeural", @@ -147,6 +151,8 @@ DEFAULT_VOICES = { "ne-NP": "HemkalaNeural", "nl-BE": "DenaNeural", "nl-NL": "ColetteNeural", + "or-IN": "SubhasiniNeural", + "pa-IN": "OjasNeural", "pl-PL": "AgnieszkaNeural", "ps-AF": "LatifaNeural", "pt-BR": "FranciscaNeural", @@ -158,6 +164,7 @@ DEFAULT_VOICES = { "sl-SI": "PetraNeural", "so-SO": "UbaxNeural", "sq-AL": "AnilaNeural", + "sr-Latn-RS": "NicholasNeural", "sr-RS": "SophieNeural", "su-ID": "TutiNeural", "sv-SE": "SofieNeural", @@ -177,12 +184,9 @@ DEFAULT_VOICES = { "vi-VN": "HoaiMyNeural", "wuu-CN": "XiaotongNeural", "yue-CN": "XiaoMinNeural", - "zh-CN": "XiaoxiaoNeural", "zh-CN-henan": "YundengNeural", - "zh-CN-liaoning": "XiaobeiNeural", - "zh-CN-shaanxi": "XiaoniNeural", "zh-CN-shandong": "YunxiangNeural", - "zh-CN-sichuan": "YunxiNeural", + "zh-CN": "XiaoxiaoNeural", "zh-HK": "HiuMaanNeural", "zh-TW": "HsiaoChenNeural", "zu-ZA": "ThandoNeural", @@ -328,7 +332,13 @@ class CloudTTSEntity(TextToSpeechEntity): """Return a list of supported voices for a language.""" if not (voices := TTS_VOICES.get(language)): return None - return [Voice(voice, voice) for voice in voices] + return [ + Voice( + voice, + voice_info["name"] if isinstance(voice_info, dict) else voice_info, + ) + for voice, voice_info in voices.items() + ] async def async_get_tts_audio( self, message: str, language: str, options: dict[str, Any] @@ -401,7 +411,13 @@ class CloudProvider(Provider): """Return a list of supported voices for a language.""" if not (voices := TTS_VOICES.get(language)): return None - return [Voice(voice, voice) for voice in voices] + return [ + Voice( + voice, + voice_info["name"] if isinstance(voice_info, dict) else voice_info, + ) + for voice, voice_info in voices.items() + ] @property def default_options(self) -> dict[str, str]: diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 6bfb571126a..febd6d25918 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -35,7 +35,7 @@ fnv-hash-fast==1.5.0 go2rtc-client==0.1.2 ha-ffmpeg==3.2.2 habluetooth==3.39.0 -hass-nabucasa==0.94.0 +hass-nabucasa==0.96.0 hassil==2.2.3 home-assistant-bluetooth==1.13.1 home-assistant-frontend==20250411.0 diff --git a/pyproject.toml b/pyproject.toml index 9487ac6c984..b5073a0d3c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ dependencies = [ "ha-ffmpeg==3.2.2", # hass-nabucasa is imported by helpers which don't depend on the cloud # integration - "hass-nabucasa==0.94.0", + "hass-nabucasa==0.96.0", # hassil is indirectly imported from onboarding via the import chain # onboarding->cloud->assist_pipeline->conversation->hassil. Onboarding needs # to be setup in stage 0, but we don't want to also promote cloud with all its diff --git a/requirements.txt b/requirements.txt index fe8a0a919aa..503a3bb2381 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,7 +23,7 @@ ciso8601==2.3.2 cronsim==2.6 fnv-hash-fast==1.5.0 ha-ffmpeg==3.2.2 -hass-nabucasa==0.94.0 +hass-nabucasa==0.96.0 hassil==2.2.3 httpx==0.28.1 home-assistant-bluetooth==1.13.1 diff --git a/requirements_all.txt b/requirements_all.txt index 2bb5d708590..1d1e111ebfc 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1120,7 +1120,7 @@ habiticalib==0.3.7 habluetooth==3.39.0 # homeassistant.components.cloud -hass-nabucasa==0.94.0 +hass-nabucasa==0.96.0 # homeassistant.components.splunk hass-splunk==0.1.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index e4adacf29aa..edf43480807 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -962,7 +962,7 @@ habiticalib==0.3.7 habluetooth==3.39.0 # homeassistant.components.cloud -hass-nabucasa==0.94.0 +hass-nabucasa==0.96.0 # homeassistant.components.conversation hassil==2.2.3 diff --git a/tests/components/cloud/test_http_api.py b/tests/components/cloud/test_http_api.py index 81e8554ebf2..73ec1aceb55 100644 --- a/tests/components/cloud/test_http_api.py +++ b/tests/components/cloud/test_http_api.py @@ -20,7 +20,7 @@ from hass_nabucasa.auth import ( ) from hass_nabucasa.const import STATE_CONNECTED from hass_nabucasa.remote import CertificateStatus -from hass_nabucasa.voice import TTS_VOICES +from hass_nabucasa.voice_data import TTS_VOICES import pytest from syrupy.assertion import SnapshotAssertion diff --git a/tests/components/cloud/test_tts.py b/tests/components/cloud/test_tts.py index 81b10866dff..c920fdac264 100644 --- a/tests/components/cloud/test_tts.py +++ b/tests/components/cloud/test_tts.py @@ -6,7 +6,8 @@ from http import HTTPStatus from typing import Any from unittest.mock import AsyncMock, MagicMock, patch -from hass_nabucasa.voice import TTS_VOICES, VoiceError, VoiceTokenError +from hass_nabucasa.voice import VoiceError, VoiceTokenError +from hass_nabucasa.voice_data import TTS_VOICES import pytest import voluptuous as vol @@ -203,7 +204,7 @@ async def test_provider_properties( assert "nl-NL" in engine.supported_languages supported_voices = engine.async_get_supported_voices("nl-NL") assert supported_voices is not None - assert Voice("ColetteNeural", "ColetteNeural") in supported_voices + assert Voice("ColetteNeural", "Colette") in supported_voices supported_voices = engine.async_get_supported_voices("missing_language") assert supported_voices is None