forked from platypush/platypush
Older versions of the assistant SDK don't have the ON_RENDER_RESPONSE event - check if they have it defined before testing the event type
This commit is contained in:
parent
8708d53236
commit
a4273f5619
1 changed files with 1 additions and 1 deletions
|
@ -52,7 +52,7 @@ class AssistantGoogleBackend(Backend):
|
||||||
self.bus.post(ConversationTimeoutEvent())
|
self.bus.post(ConversationTimeoutEvent())
|
||||||
elif event.type == EventType.ON_NO_RESPONSE:
|
elif event.type == EventType.ON_NO_RESPONSE:
|
||||||
self.bus.post(NoResponseEvent())
|
self.bus.post(NoResponseEvent())
|
||||||
elif event.type == EventType.ON_RENDER_RESPONSE:
|
elif hasattr(EventType, 'ON_RENDER_RESPONSE') and event.type == EventType.ON_RENDER_RESPONSE:
|
||||||
self.bus.post(ResponseEvent(response_text=event.args.get('text')))
|
self.bus.post(ResponseEvent(response_text=event.args.get('text')))
|
||||||
elif event.type == EventType.ON_RECOGNIZING_SPEECH_FINISHED:
|
elif event.type == EventType.ON_RECOGNIZING_SPEECH_FINISHED:
|
||||||
phrase = event.args['text'].lower().strip()
|
phrase = event.args['text'].lower().strip()
|
||||||
|
|
Loading…
Reference in a new issue