Google Assistant plugin to programmatically start/stop conversation
This commit is contained in:
parent
720ab38673
commit
c201d725b7
2 changed files with 22 additions and 0 deletions
|
@ -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()
|
||||
|
||||
|
|
18
platypush/plugins/assistant/google/__init__.py
Normal file
18
platypush/plugins/assistant/google/__init__.py
Normal file
|
@ -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:
|
||||
|
Loading…
Reference in a new issue