Google TTS can't read percent sign (#6971) (#7030)

This commit is contained in:
pezinek 2017-04-11 10:27:45 +02:00 committed by Pascal Vizeli
parent aa3ccf16ca
commit 197db6bded
2 changed files with 9 additions and 8 deletions

View File

@ -87,7 +87,7 @@ class GoogleProvider(Provider):
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,

View File

@ -23,10 +23,11 @@ class TestTTSGooglePlatform(object):
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 @@ class TestTTSGooglePlatform(object):
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 @@ class TestTTSGooglePlatform(object):
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 @@ class TestTTSGooglePlatform(object):
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 @@ class TestTTSGooglePlatform(object):
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 @@ class TestTTSGooglePlatform(object):
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()