mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Update pushbullet to use latest 0.4 npm and allow iden as well as id
This commit is contained in:
parent
66598a66b1
commit
4a53c20792
@ -29,9 +29,10 @@
|
|||||||
<p>Uses PushBullet to push the <b>msg.payload</b> to an Android device that has PushBullet app installed.</p>
|
<p>Uses PushBullet to push the <b>msg.payload</b> to an Android device that has PushBullet app installed.</p>
|
||||||
<p>Optionally uses <b>msg.topic</b> to set the title, if not already set in the properties.</p>
|
<p>Optionally uses <b>msg.topic</b> to set the title, if not already set in the properties.</p>
|
||||||
<p>You MUST configure both your API key and the target device ID. Either into settings.js like this</p>
|
<p>You MUST configure both your API key and the target device ID. Either into settings.js like this</p>
|
||||||
<p><pre>pushbullet: { pushbullet:'My-API-KEY', deviceid:'12345' },</pre></p>
|
<p><pre>pushbullet: { pushbullet:'My-API-KEY', deviceid:'xyzzyWabc' },</pre></p>
|
||||||
<p>Or as a pushkey.js file in the directory <b>above</b> node-red.<p>
|
<p>Or as a pushkey.js file in the directory <b>above</b> node-red.<p>
|
||||||
<p><pre>module.exports = { pushbullet:'My-API-KEY', deviceid:'12345' }</pre></p>
|
<p><pre>module.exports = { pushbullet:'My-API-KEY', deviceid:'xyzzyWabc' }</pre></p>
|
||||||
|
<p>The deviceid can be found by hovering over you required device on the <a href="https://www.pushbullet.com/">PushBullet website</a>.</p>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@ -44,8 +44,9 @@ function PushbulletNode(n) {
|
|||||||
if (typeof(msg.payload) == 'object') {
|
if (typeof(msg.payload) == 'object') {
|
||||||
msg.payload = JSON.stringify(msg.payload);
|
msg.payload = JSON.stringify(msg.payload);
|
||||||
}
|
}
|
||||||
if (pushkey) {
|
if (pushkey.pushbullet && pushkey.deviceid) {
|
||||||
try {
|
try {
|
||||||
|
if (!isNaN(deviceId)) { deviceId = Number(deviceId); }
|
||||||
pusher.note(deviceId, titl, msg.payload, function(err, response) {
|
pusher.note(deviceId, titl, msg.payload, function(err, response) {
|
||||||
if (err) node.error(err);
|
if (err) node.error(err);
|
||||||
console.log(response);
|
console.log(response);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user