diff --git a/button-pressed.html b/button-pressed.html index fcc1210..70db751 100644 --- a/button-pressed.html +++ b/button-pressed.html @@ -4,7 +4,8 @@ color: '#F3EC14', defaults: { name: {value:"Dash Button"}, - mac: {value:""} + mac: {value:""}, + interface: {value:""} }, inputs:0, outputs:1, @@ -24,11 +25,16 @@
- + +
+
+ +
\ No newline at end of file diff --git a/button-pressed.js b/button-pressed.js index 5495b93..cf1a0dd 100644 --- a/button-pressed.js +++ b/button-pressed.js @@ -8,13 +8,16 @@ module.exports = function(RED) { var node = this; var mac = config.mac || ''; + // if there are mutliple addresses we split the chain + mac = mac.split(','); + var interface = config.interface || null; console.log(mac); - var dash = dash_button(mac); - var found = function () { - console.log('Button Pressed: ' + mac); - var msg = {}; + var dash = dash_button(mac, interface); + var found = function (dash_id) { + console.log('Button Pressed: ' + dash_id); + var msg = {"mac": dash_id}; node.send(msg); };