diff --git a/platypush/backend/assistant/google/__init__.py b/platypush/backend/assistant/google/__init__.py index e432fef3..43cbc20a 100644 --- a/platypush/backend/assistant/google/__init__.py +++ b/platypush/backend/assistant/google/__init__.py @@ -48,6 +48,10 @@ class AssistantGoogleBackend(Backend): self.bus.post(SpeechRecognizedEvent(phrase=phrase)) + def start_conversation(self): + if self.assistant: self.assistant.start_conversation() + + def stop_conversation(self): if self.assistant: self.assistant.stop_conversation() diff --git a/platypush/plugins/assistant/google/__init__.py b/platypush/plugins/assistant/google/__init__.py new file mode 100644 index 00000000..a3589284 --- /dev/null +++ b/platypush/plugins/assistant/google/__init__.py @@ -0,0 +1,18 @@ +from platypush.context import get_backend +from platypush.message.response import Response + +from platypush.plugins import Plugin + +class AssistantGooglePlugin(Plugin): + def start_conversation(self): + assistant = get_backend('assistant.google') + assistant.start_conversation() + return Response(output='', errors=[]) + + def stop_conversation(self): + assistant = get_backend('assistant.google') + assistant.stop_conversation() + return Response(output='', errors=[]) + +# vim:sw=4:ts=4:et: +