mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Catch ValueError in google_translate (#42405)
This commit is contained in:
parent
0de52c173c
commit
a12a8350ce
@ -161,7 +161,6 @@ homeassistant/components/goalzero/* @tkdrob
|
|||||||
homeassistant/components/gogogate2/* @vangorra
|
homeassistant/components/gogogate2/* @vangorra
|
||||||
homeassistant/components/google_assistant/* @home-assistant/cloud
|
homeassistant/components/google_assistant/* @home-assistant/cloud
|
||||||
homeassistant/components/google_cloud/* @lufton
|
homeassistant/components/google_cloud/* @lufton
|
||||||
homeassistant/components/google_translate/* @awarecan
|
|
||||||
homeassistant/components/gpsd/* @fabaff
|
homeassistant/components/gpsd/* @fabaff
|
||||||
homeassistant/components/gree/* @cmroche
|
homeassistant/components/gree/* @cmroche
|
||||||
homeassistant/components/greeneye_monitor/* @jkeljo
|
homeassistant/components/greeneye_monitor/* @jkeljo
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
"name": "Google Translate Text-to-Speech",
|
"name": "Google Translate Text-to-Speech",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/google_translate",
|
"documentation": "https://www.home-assistant.io/integrations/google_translate",
|
||||||
"requirements": ["gTTS-token==1.1.3"],
|
"requirements": ["gTTS-token==1.1.3"],
|
||||||
"codeowners": ["@awarecan"]
|
"codeowners": []
|
||||||
}
|
}
|
||||||
|
@ -123,9 +123,14 @@ class GoogleProvider(Provider):
|
|||||||
|
|
||||||
data = b""
|
data = b""
|
||||||
for idx, part in enumerate(message_parts):
|
for idx, part in enumerate(message_parts):
|
||||||
part_token = await self.hass.async_add_executor_job(
|
try:
|
||||||
token.calculate_token, part
|
part_token = await self.hass.async_add_executor_job(
|
||||||
)
|
token.calculate_token, part
|
||||||
|
)
|
||||||
|
except ValueError as err:
|
||||||
|
# If token seed fetching fails.
|
||||||
|
_LOGGER.warning(err)
|
||||||
|
return None, None
|
||||||
|
|
||||||
url_param = {
|
url_param = {
|
||||||
"ie": "UTF-8",
|
"ie": "UTF-8",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user