1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

updates for new version of nma package

This commit is contained in:
Edwin Hermans 2014-12-12 01:01:18 +01:00
parent e5d75fbd9b
commit 24282291f4

View File

@ -32,11 +32,17 @@ module.exports = function(RED) {
}
else { msg.payload = msg.payload.toString(); }
if (node.pushkey) {
try {
nma(node.pushkey, "Node-RED", titl, msg.payload, 0 );
} catch (e) {
node.warn("NMA error: "+ e);
nma({
"apikey": node.pushkey,
"application": "Node-RED",
"event": titl,
"description": msg.payload,
"priority": 0
}, function (error) {
if (error) {
node.warn("NMA error: " + error);
}
});
}
else {
node.warn("NMA credentials not set.");