Call Google Assistant SDK service using async_add_executor_job (#117325)
This commit is contained in:
parent
38ce7b15b0
commit
492ef67d02
2 changed files with 4 additions and 2 deletions
|
@ -169,7 +169,9 @@ class GoogleAssistantConversationAgent(conversation.AbstractConversationAgent):
|
|||
self.language = user_input.language
|
||||
self.assistant = TextAssistant(credentials, self.language)
|
||||
|
||||
resp = self.assistant.assist(user_input.text)
|
||||
resp = await self.hass.async_add_executor_job(
|
||||
self.assistant.assist, user_input.text
|
||||
)
|
||||
text_response = resp[0] or "<empty response>"
|
||||
|
||||
intent_response = intent.IntentResponse(language=user_input.language)
|
||||
|
|
|
@ -79,7 +79,7 @@ async def async_send_text_commands(
|
|||
) as assistant:
|
||||
command_response_list = []
|
||||
for command in commands:
|
||||
resp = assistant.assist(command)
|
||||
resp = await hass.async_add_executor_job(assistant.assist, command)
|
||||
text_response = resp[0]
|
||||
_LOGGER.debug("command: %s\nresponse: %s", command, text_response)
|
||||
audio_response = resp[2]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue