2
0

feat(actions): add click and double click actions

This commit is contained in:
Pierre CLEMENT
2018-01-01 03:31:51 +01:00
parent 27619fb7fa
commit 7742e99f75
10 changed files with 187 additions and 35 deletions

View File

@@ -22,6 +22,7 @@ module.exports = function(RED) {
// The Input Node
function GatewayIn(n) {
RED.nodes.createNode(this,n);
this.gateway = RED.nodes.getNode(n.gateway);
this.group = "224.0.0.50";
this.port = 9898;
this.iface = null;
@@ -62,6 +63,9 @@ module.exports = function(RED) {
jsonMsg.data = JSON.parse(jsonMsg.data) || jsonMsg.data;
}
msg = { payload: jsonMsg };
if(jsonMsg.token && node.gateway && jsonMsg.data.ip && jsonMsg.data.ip === node.gateway.ip) {
node.gateway.lastToken = jsonMsg.token;
}
node.send(msg);
}
});