Remove side effects from Watson TTS init (#50716)
This commit is contained in:
parent
a414cad3b2
commit
059e7c925d
1 changed files with 6 additions and 6 deletions
|
@ -147,6 +147,12 @@ def get_engine(hass, config, discovery_info=None):
|
||||||
output_format = config[CONF_OUTPUT_FORMAT]
|
output_format = config[CONF_OUTPUT_FORMAT]
|
||||||
service.set_default_headers({"x-watson-learning-opt-out": "true"})
|
service.set_default_headers({"x-watson-learning-opt-out": "true"})
|
||||||
|
|
||||||
|
if default_voice in DEPRECATED_VOICES:
|
||||||
|
_LOGGER.warning(
|
||||||
|
"Watson TTS voice %s is deprecated, it may be removed in the future",
|
||||||
|
default_voice,
|
||||||
|
)
|
||||||
|
|
||||||
return WatsonTTSProvider(service, supported_languages, default_voice, output_format)
|
return WatsonTTSProvider(service, supported_languages, default_voice, output_format)
|
||||||
|
|
||||||
|
|
||||||
|
@ -162,12 +168,6 @@ class WatsonTTSProvider(Provider):
|
||||||
self.output_format = output_format
|
self.output_format = output_format
|
||||||
self.name = "Watson TTS"
|
self.name = "Watson TTS"
|
||||||
|
|
||||||
if self.default_voice in DEPRECATED_VOICES:
|
|
||||||
_LOGGER.warning(
|
|
||||||
"Watson TTS voice %s is deprecated, it may be removed in the future",
|
|
||||||
self.default_voice,
|
|
||||||
)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_languages(self):
|
def supported_languages(self):
|
||||||
"""Return a list of supported languages."""
|
"""Return a list of supported languages."""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue