mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Call Google Assistant SDK service using async_add_executor_job (#117325)
This commit is contained in:
parent
38ce7b15b0
commit
492ef67d02
@ -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…
x
Reference in New Issue
Block a user