Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Pushbullet.com Notifications #422

Merged
merged 1 commit into from
Jun 27, 2014

Conversation

krkeegan
Copy link
Collaborator

Pushbullet is similar to Pushover. It allows you to send notification messages directly from MH to your devices.

A device can be an iOS or Android phone, a windows PC, or any Chrome browser. All of the clients are free and the service is free.

Pushbullet has many features:

  • Send notes, urls, files, lists, and addresses
  • Add multiple devices and friends
  • Choose which devices and friends to send a particular push to

Right now the code provides a user friendly mechanism to send notes. A low level module also provides raw support for sending whatever you want to the Pushbullet API. In future commits, I hope to make additional features easy to use.

The addition of this feature to MH and some of the code was inspired by George Clark's work on the Pushover support.

krkeegan added a commit that referenced this pull request Jun 27, 2014
Add Support for Pushbullet.com Notifications
@krkeegan krkeegan merged commit e73e076 into hollie:master Jun 27, 2014
Pushbullet is similar to Pushover.  It allows you to send notification messages directly from MH to your devices.

A device can be an iOS or Android phone, a windows PC, or any Chrome browser.  All of the clients are free and the service is free.

Pushbullet has many features:
- Send notes, urls, files, lists, and addresses
- Add multiple devices and friends
- Choose which devices and friends to send a particular push to

Right now the code provides a user friendly mechanism to send notes.  A low level module also provides raw support for sending whatever you want to the Pushbullet API.  In future commits, I hope to make additional features easy to use.

The addition of this feature to MH and some of the code was inspired by George Clark's work on the Pushover support.
@hollie
Copy link
Owner

hollie commented Jul 20, 2014

Hey @krkeegan, I'm experimenting with this but I fail to get it working properly.

I have defined the Pushbullet_xxx parameters in mh.private.ini

Pushbullet_token=my_token_from_the_pushbullet_account_settings
Pushbullet_title="MisterHouse"
Pushbullet_disable=0

I have defined in items.mht:

CODE, require Pushbullet; #noloop 
CODE, my $pbullet = new Pushbullet(); #noloop

I have the following code to test it out:

#Category=Interface

#noloop=start
$pbullet_test = new Voice_Cmd 'Send pushbullet test command';
#noloop=stop

if (said $pbullet_test) {

    $pbullet->push_note("Test message", "This is a MisterHouse test message -- " . $verwarm_depart->state);
    ::print_log("Tried sending the pushbullet message");
}

But when I run the voice command I get:

07/20/14 19:18:59  Running: Send pushbullet test command
07/20/14 19:18:59  [Pushbullet] message: This is a MisterHouse test message -- 23.87
normal: Pushbullet notification This is a MisterHouse test message -- 23.87
07/20/14 19:18:59  FUNCTION: set_volume_pre_hook
07/20/14 19:18:59  [Pushbullet] ERROR: POST Failed: Status:  -
07/20/14 19:18:59  Tried sending the pushbullet message
07/20/14 19:18:59  Setting speakers ON

Is this something you encountered when you were testing the code?

krkeegan added a commit to krkeegan/misterhouse that referenced this pull request Jul 21, 2014
… Message

It looks like Pushbullet changed the structure of the JSON for error messages.  This should now cause them to be printed for diagnostic purposes.

Fixes issue reported in hollie#422 by @hollie
@krkeegan
Copy link
Collaborator Author

@hollie Yup, I had a bug in reading the token from the ini and for whatever reason, Pushbullet changed the JSON structure for reporting the error message so it wasn't appearing in our log.

I also changed the example, using my in the CODE definition isn't required and may actually cause some odd results.

Let me know if this does it. Kevin

@hollie
Copy link
Owner

hollie commented Jul 21, 2014

Hey Kevin,

yes, your pull request fixes the issue.

For others: the example I gave for the Pushbullet_token in the error report is wrong: it needs to be without the "..". Just copy the token and paste it in the ini file. I have fixed the comment for later reference.

I have merged your pull request already.

Thanks for looking into this!

Hollie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants