mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Bump hass-nabucasa to 0.96.0 (#143542)
* Bump hass-nabucasa to 0.96.0 * Adjust for new voice info format
This commit is contained in:
parent
f69484ba02
commit
fa80c0a88d
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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]:
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
2
requirements.txt
generated
2
requirements.txt
generated
@ -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
|
||||
|
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@ -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
|
||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user