From a4273f56198e3b7184b5fb434ce8cd8363346656 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 21 Jun 2018 01:29:04 +0200 Subject: [PATCH] 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 --- platypush/backend/assistant/google/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/backend/assistant/google/__init__.py b/platypush/backend/assistant/google/__init__.py index d6c4264e..1a4c0bdc 100644 --- a/platypush/backend/assistant/google/__init__.py +++ b/platypush/backend/assistant/google/__init__.py @@ -52,7 +52,7 @@ class AssistantGoogleBackend(Backend): self.bus.post(ConversationTimeoutEvent()) elif event.type == EventType.ON_NO_RESPONSE: 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'))) elif event.type == EventType.ON_RECOGNIZING_SPEECH_FINISHED: phrase = event.args['text'].lower().strip()