node-red-contrib-ifttt
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -10,3 +10,3 @@ var request = require('request'); | ||
RED.nodes.registerType("ifttt-key",IftttKeyNode, {credentials: {key: {type: 'text'}}}); | ||
RED.nodes.registerType('ifttt-key',IftttKeyNode, {credentials: {key: {type: 'text'}}}); | ||
@@ -18,6 +18,6 @@ // This is the output node. | ||
node.config = config; | ||
node.key = RED.nodes.getNode(config.key).credentials.key; | ||
node.key = RED.nodes.getNode(config.key); | ||
this.on('input', function(msg) { | ||
node.status({fill:"blue",shape:"dot",text:"Sending..."}); | ||
request.post('https://maker.ifttt.com/trigger/' + node.config.eventName + '/with/key/' + node.key, { | ||
request.post('https://maker.ifttt.com/trigger/' + node.config.eventName + '/with/key/' + node.key.credentials.key, { | ||
value1: msg.payload.value1, | ||
@@ -29,16 +29,18 @@ value2: msg.payload.value2, | ||
node.status({fill:"green",shape:"dot",text:"Sent!"}); | ||
setTimeout(function () { | ||
node.status(); | ||
}, 1000); | ||
// msg.payload = response; | ||
// node.send(msg); | ||
} else { | ||
node.error('IFTTT'); | ||
node.status({fill:"red",shape:"dot",text:"Error!"}); | ||
node.error(JSON.parse(body).errors[0].message); | ||
} | ||
setTimeout(function () { | ||
node.status({}); | ||
}, 1000); | ||
}); | ||
}); | ||
} | ||
RED.nodes.registerType("ifttt",IftttOutNode); | ||
RED.nodes.registerType("ifttt out",IftttOutNode); | ||
}; |
{ | ||
"name": "node-red-contrib-ifttt", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "A node-red node to connect to ifttt Maker channel", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/diegopamio/node-red-ifttt", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10061
5
37