From 31752d5736d512e9bfb0481f809e7c51de94d5dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Rutkai?= Date: Sun, 3 Nov 2019 05:24:02 +0100 Subject: [PATCH] Fixing #27722 Watson TTS platform (sdk upgrade) (#28468) --- homeassistant/components/watson_tts/manifest.json | 2 +- homeassistant/components/watson_tts/tts.py | 5 ++++- requirements_all.txt | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/watson_tts/manifest.json b/homeassistant/components/watson_tts/manifest.json index 4cde3f764e5..e5f3efae04c 100644 --- a/homeassistant/components/watson_tts/manifest.json +++ b/homeassistant/components/watson_tts/manifest.json @@ -3,7 +3,7 @@ "name": "IBM Watson TTS", "documentation": "https://www.home-assistant.io/integrations/watson_tts", "requirements": [ - "ibm-watson==3.0.3" + "ibm-watson==4.0.1" ], "dependencies": [], "codeowners": [ diff --git a/homeassistant/components/watson_tts/tts.py b/homeassistant/components/watson_tts/tts.py index a30d08f31f3..021767e3d11 100644 --- a/homeassistant/components/watson_tts/tts.py +++ b/homeassistant/components/watson_tts/tts.py @@ -93,8 +93,11 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( def get_engine(hass, config): """Set up IBM Watson TTS component.""" from ibm_watson import TextToSpeechV1 + from ibm_cloud_sdk_core.authenticators import IAMAuthenticator - service = TextToSpeechV1(url=config[CONF_URL], iam_apikey=config[CONF_APIKEY]) + authenticator = IAMAuthenticator(config[CONF_APIKEY]) + service = TextToSpeechV1(authenticator) + service.set_service_url(config[CONF_URL]) supported_languages = list({s[:5] for s in SUPPORTED_VOICES}) default_voice = config[CONF_VOICE] diff --git a/requirements_all.txt b/requirements_all.txt index a582478d132..cf2c0cb7918 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -685,7 +685,7 @@ hydrawiser==0.1.1 iaqualink==0.3.0 # homeassistant.components.watson_tts -ibm-watson==3.0.3 +ibm-watson==4.0.1 # homeassistant.components.watson_iot ibmiotf==0.3.4