2018-06-23 01:00:43 +02:00
|
|
|
"""
|
|
|
|
.. moduleauthor:: Fabio Manganiello <blacklight86@gmail.com>
|
|
|
|
"""
|
|
|
|
|
2018-03-21 23:21:41 +01:00
|
|
|
from platypush.context import get_backend
|
2018-07-06 02:08:38 +02:00
|
|
|
from platypush.plugins import Plugin, action
|
2018-03-21 23:21:41 +01:00
|
|
|
|
|
|
|
class AssistantGooglePushtotalkPlugin(Plugin):
|
2018-06-23 01:00:43 +02:00
|
|
|
"""
|
|
|
|
Plugin for the Google assistant pushtotalk API. It acts as a wrapper to
|
|
|
|
programmatically control a
|
|
|
|
:mod:`platypush.backend.assistant.google.pushtotalk` backend.
|
|
|
|
"""
|
|
|
|
|
2018-07-06 02:08:38 +02:00
|
|
|
def __init__(*args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
@action
|
2018-03-21 23:21:41 +01:00
|
|
|
def start_conversation(self):
|
2018-06-23 01:00:43 +02:00
|
|
|
"""
|
|
|
|
Programmatically start a conversation with the assistant
|
|
|
|
"""
|
2018-03-21 23:21:41 +01:00
|
|
|
assistant = get_backend('assistant.google.pushtotalk')
|
|
|
|
assistant.start_conversation()
|
|
|
|
|
2018-07-06 02:08:38 +02:00
|
|
|
@action
|
2018-03-21 23:21:41 +01:00
|
|
|
def stop_conversation(self):
|
2018-06-23 01:00:43 +02:00
|
|
|
"""
|
|
|
|
Programmatically stop a running conversation with the assistant
|
|
|
|
"""
|
2018-03-21 23:21:41 +01:00
|
|
|
assistant = get_backend('assistant.google.pushtotalk')
|
|
|
|
assistant.stop_conversation()
|
|
|
|
|
|
|
|
# vim:sw=4:ts=4:et:
|
|
|
|
|