richard-better / pushbullet.py

A python client for http://pushbullet.com
MIT License
575 stars 110 forks source link

Chat API support #57

Closed tomduijf closed 8 years ago

tomduijf commented 8 years ago

Hi there.

We used this module for pushbullet integration in balloob/home-assistant Works awesome, keep up the good work!

Noticed that the contact don't seem to work. Result always is an empty list [] (yes, valid contacts in account). Perhaps im doing something wrong, if so i'd appreciate the feedback :)

from pushbullet import PushBullet
pb = PushBullet('yourkeygoeshere')
pb.contacts

PB integrated in HASS (how we use your module, and a little shameless plug ;) ) https://github.com/balloob/home-assistant/blob/dev/homeassistant/components/notify/pushbullet.py

benbuf commented 8 years ago

in the pushbullet api docs changelog its says:

"Removed Contacts calls as the official apps no longer user Contacts. These have been replaced with the Chat objects."

https://docs.pushbullet.com/v12/#changelog

kovacsbalu commented 8 years ago

Hi! @benbuf you are right! We need to support chat api. @tomduijf now I re-test the contacts and looks good with pushbullet.py and also with curl check. Do see any on pushbullet web https://www.pushbullet.com/#settings/people ? For example (I change some personal data):

>>> from pushbullet import PushBullet
>>> pb = PushBullet("token")
>>> pb.contacts
[Contact('User Name' <user.name@example.com>)]
curl -u token: -X GET https://api.pushbullet.com/v2/contacts
{"accounts":[],"blocks":[],"channels":[],"chats":[],"clients":[],"contacts":[{"active":true,"iden":"aaabbbcccdddeeefffgggh","created":1.430499126449944e+09,"modified":1.430499126459729e+09,"name":"User Name","email":"user.name@example.com","email_normalized":"username@example.com","image_url":"https://lh5.googleusercontent.com/-aaabbbbcccc/AAAAAAAAAAI/AAAAAAAAAAA/aaabbbcccdd/photo.jpg","status":"user"}],"devices":[],"grants":[],"pushes":[],"profiles":[],"subscriptions":[],"texts":[]}
tomduijf commented 8 years ago

@kovacsbalu haven't tested it in a while. At the time of submitting this issue it wasn't working (perhaps pb restored part of the functionality for backward compatibility).