1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Completed migration to v2 Pushbullet API. Added extra debug logging.

This commit is contained in:
tlex 2014-07-28 07:30:13 +02:00
parent 480199085e
commit 789f87090a
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(current_pushbullet_device == devices[i].iden) { if(devices[i].active == true) {
$("#pushbullet_device_list").append('<option value="'+devices[i].iden+'" selected>' + devices[i].extras.nickname + '</option>') if(current_pushbullet_device == devices[i].iden) {
} else { $("#pushbullet_device_list").append('<option value="'+devices[i].iden+'" selected>' + devices[i].nickname + '</option>')
$("#pushbullet_device_list").append('<option value="'+devices[i].iden+'">' + devices[i].extras.nickname + '</option>') } else {
$("#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: