1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 11:32:20 -05:00

Merge pull request #671 from tlex/migrate-pushbullet-api

Completed migration to v2 Pushbullet API. Added extra debug logging.
This commit is contained in:
echel0n 2014-07-28 09:07:10 -07:00
commit 6efc24844a
2 changed files with 8 additions and 5 deletions

View File

@ -268,10 +268,12 @@ $(document).ready(function(){
var devices = jQuery.parseJSON(data).devices; var devices = jQuery.parseJSON(data).devices;
$("#pushbullet_device_list").html(''); $("#pushbullet_device_list").html('');
for (var i = 0; i < devices.length; i++) { for (var i = 0; i < devices.length; i++) {
if(devices[i].active == true) {
if(current_pushbullet_device == devices[i].iden) { if(current_pushbullet_device == devices[i].iden) {
$("#pushbullet_device_list").append('<option value="'+devices[i].iden+'" selected>' + devices[i].extras.nickname + '</option>') $("#pushbullet_device_list").append('<option value="'+devices[i].iden+'" selected>' + devices[i].nickname + '</option>')
} else { } else {
$("#pushbullet_device_list").append('<option value="'+devices[i].iden+'">' + devices[i].extras.nickname + '</option>') $("#pushbullet_device_list").append('<option value="'+devices[i].iden+'">' + devices[i].nickname + '</option>')
}
} }
} }
if(msg) { if(msg) {

View File

@ -69,7 +69,7 @@ class PushbulletNotifier:
if method == 'POST': if method == 'POST':
uri = '/v2/pushes' uri = '/v2/pushes'
else: else:
uri = '/api/devices' uri = '/v2/devices'
logger.log(u"Pushbullet event: " + str(event), logger.DEBUG) logger.log(u"Pushbullet event: " + str(event), logger.DEBUG)
logger.log(u"Pushbullet message: " + str(message), logger.DEBUG) logger.log(u"Pushbullet message: " + str(message), logger.DEBUG)
@ -106,6 +106,7 @@ class PushbulletNotifier:
response = http_handler.getresponse() response = http_handler.getresponse()
request_body = response.read() request_body = response.read()
request_status = response.status request_status = response.status
logger.log(u"Pushbullet response: %s" % request_body, logger.DEBUG)
if request_status == 200: if request_status == 200:
if testMessage: if testMessage: