From fbce006772082097db78bea65f0eb3f2181327ae Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 1 Oct 2018 15:06:26 +0200 Subject: [PATCH] Fixed send_note pushbullet method --- platypush/plugins/pushbullet.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/platypush/plugins/pushbullet.py b/platypush/plugins/pushbullet.py index c118253c1..8e4c53e2c 100644 --- a/platypush/plugins/pushbullet.py +++ b/platypush/plugins/pushbullet.py @@ -21,21 +21,20 @@ class PushbulletPlugin(Plugin): super().__init__(*args, **kwargs) @action - def send_push(self, **kwargs): + def send_note(self, body=None, title=None, **kwargs): """ - Send a push. + Send a note push. :param kwargs: Push arguments, see https://docs.pushbullet.com/#create-push :type kwargs: dict """ pushbullet = get_backend('pushbullet') - resp = requests.post('https://api.pushbullet.com/v2/ephemerals', - data=json.dumps({ - 'type':'push', - 'push': kwargs, - }), - + kwargs['body'] = body + kwargs['title'] = title + kwargs['type'] = 'note' + resp = requests.post('https://api.pushbullet.com/v2/pushes', + data=json.dumps(kwargs), headers={'Authorization': 'Bearer ' + pushbullet.token, 'Content-Type': 'application/json'})