diff --git a/homeassistant/components/tts/google.py b/homeassistant/components/tts/google.py index d433aef8c47ce..e88022a8ba942 100644 --- a/homeassistant/components/tts/google.py +++ b/homeassistant/components/tts/google.py @@ -87,7 +87,7 @@ def async_get_tts_audio(self, message, language, options=None): url_param = { 'ie': 'UTF-8', 'tl': language, - 'q': yarl.quote(part), + 'q': yarl.quote(part, strict=False), 'tk': part_token, 'total': len(message_parts), 'idx': idx, diff --git a/tests/components/tts/test_google.py b/tests/components/tts/test_google.py index 4cbec95dc2bcd..9f7cc9e9d502b 100644 --- a/tests/components/tts/test_google.py +++ b/tests/components/tts/test_google.py @@ -23,10 +23,11 @@ def setup_method(self): self.url = "http://translate.google.com/translate_tts" self.url_param = { 'tl': 'en', - 'q': 'I%20person%20is%20on%20front%20of%20your%20door.', + 'q': + '90%25%20of%20I%20person%20is%20on%20front%20of%20your%20door.', 'tk': 5, 'client': 'tw-ob', - 'textlen': 34, + 'textlen': 41, 'total': 1, 'idx': 0, 'ie': 'UTF-8', @@ -70,7 +71,7 @@ def test_service_say(self, mock_calculate, aioclient_mock): setup_component(self.hass, tts.DOMAIN, config) self.hass.services.call(tts.DOMAIN, 'google_say', { - tts.ATTR_MESSAGE: "I person is on front of your door.", + tts.ATTR_MESSAGE: "90% of I person is on front of your door.", }) self.hass.block_till_done() @@ -99,7 +100,7 @@ def test_service_say_german_config(self, mock_calculate, aioclient_mock): setup_component(self.hass, tts.DOMAIN, config) self.hass.services.call(tts.DOMAIN, 'google_say', { - tts.ATTR_MESSAGE: "I person is on front of your door.", + tts.ATTR_MESSAGE: "90% of I person is on front of your door.", }) self.hass.block_till_done() @@ -126,7 +127,7 @@ def test_service_say_german_service(self, mock_calculate, aioclient_mock): setup_component(self.hass, tts.DOMAIN, config) self.hass.services.call(tts.DOMAIN, 'google_say', { - tts.ATTR_MESSAGE: "I person is on front of your door.", + tts.ATTR_MESSAGE: "90% of I person is on front of your door.", tts.ATTR_LANGUAGE: "de" }) self.hass.block_till_done() @@ -153,7 +154,7 @@ def test_service_say_error(self, mock_calculate, aioclient_mock): setup_component(self.hass, tts.DOMAIN, config) self.hass.services.call(tts.DOMAIN, 'google_say', { - tts.ATTR_MESSAGE: "I person is on front of your door.", + tts.ATTR_MESSAGE: "90% of I person is on front of your door.", }) self.hass.block_till_done() @@ -179,7 +180,7 @@ def test_service_say_timeout(self, mock_calculate, aioclient_mock): setup_component(self.hass, tts.DOMAIN, config) self.hass.services.call(tts.DOMAIN, 'google_say', { - tts.ATTR_MESSAGE: "I person is on front of your door.", + tts.ATTR_MESSAGE: "90% of I person is on front of your door.", }) self.hass.block_till_done()