diff --git a/social/pushbullet/57-pushbullet.html b/social/pushbullet/57-pushbullet.html index f25b02a2..d96d0648 100644 --- a/social/pushbullet/57-pushbullet.html +++ b/social/pushbullet/57-pushbullet.html @@ -64,8 +64,8 @@
- - + +
The API key can be found on the Account Settings
@@ -87,15 +87,15 @@ defaults: { name: {value: "", required: true} //apikey: -> credentials - //deviceid -> credentials + //deviceIdent -> credentials }, label: function () { return this.name; }, oneditprepare: function () { $.getJSON('pushbullet-api/' + this.id, function (data) { - if (data.deviceid) { - $('#node-config-input-deviceid').val(data.deviceid); + if (data.deviceIdent) { + $('#node-config-input-deviceIdent').val(data.deviceIdent); } if (data.hasApiKey) { $('#node-config-input-apikey').val('__PWRD__'); @@ -111,7 +111,7 @@ if (newApiKey != '__PWRD__') { credentials.apikey = newApiKey; } - credentials.deviceid = $('#node-config-input-deviceid').val(); + credentials.deviceIdent = $('#node-config-input-deviceIdent').val(); $.ajax({ url: 'pushbullet-api/' + this.id, type: 'POST', diff --git a/social/pushbullet/57-pushbullet.js b/social/pushbullet/57-pushbullet.js index 19b5bed7..164cda8d 100644 --- a/social/pushbullet/57-pushbullet.js +++ b/social/pushbullet/57-pushbullet.js @@ -33,7 +33,7 @@ RED.httpAdmin.get('/pushbullet-api/global', function (req, res) { RED.httpAdmin.get('/pushbullet-api/:id', function (req, res) { var credentials = RED.nodes.getCredentials(req.params.id); if (credentials) { - res.send(JSON.stringify({hasApiKey: (credentials.apikey && credentials.apikey != ""), deviceid: credentials.deviceid})); + res.send(JSON.stringify({hasApiKey: (credentials.apikey && credentials.apikey != ""), deviceIdent: credentials.deviceIdent})); } else { res.send(JSON.stringify({})); } @@ -57,10 +57,10 @@ RED.httpAdmin.post('/pushbullet-api/:id', function (req, res) { } else { credentials.apikey = newCreds.apikey || credentials.apikey; } - if (newCreds.deviceid == "" || newCreds.deviceid == null) { - delete credentials.deviceid; + if (newCreds.deviceIdent == "" || newCreds.deviceIdent == null) { + delete credentials.deviceIdent; } else { - credentials.deviceid = newCreds.deviceid; + credentials.deviceIdent = newCreds.deviceIdent; } RED.nodes.addCredentials(req.params.id, credentials); res.send(200); @@ -73,7 +73,7 @@ function PushBulletDevice(n) { var credentials = RED.nodes.getCredentials(n.id); if (credentials) { this.apikey = credentials.apikey; - this.deviceid = credentials.deviceid; + this.deviceIdent = credentials.deviceIdent; } } RED.nodes.registerType("bullet-device", PushBulletDevice); @@ -86,10 +86,10 @@ function PushbulletNode(n) { if (this.api) { this.pusher = new PushBullet(this.api.apikey); - this.deviceId = this.api.deviceid; + this.deviceIdent = this.api.deviceIdent; } else if (pushkey) { this.pusher = new PushBullet(pushkey.pushbullet); - this.deviceId = pushkey.deviceid; + this.deviceIdent = pushkey.deviceid; } else { this.error("missing pushbullet credentials"); return; @@ -105,7 +105,7 @@ function PushbulletNode(n) { msg.payload = msg.payload.toString(); } try { - this.pusher.note(this.deviceId, titl, msg.payload, function (err, response) { + this.pusher.note(this.deviceIdent, titl, msg.payload, function (err, response) { if (err) node.error("Pushbullet error: " + err); //console.log(response); });