From 5aaa8aa7aa888af6f780f3bd332bb9a2cba11c2d Mon Sep 17 00:00:00 2001 From: Martin Buchleitner Date: Tue, 1 Oct 2019 11:20:53 +0200 Subject: [PATCH 1/4] fixing #51 + #57 bind to ip, #53 to discover all nodes Signed-off-by: Martin Buchleitner --- Dockerfile | 2 +- alexa/alexa-helper.js | 15 +- alexa/alexa-home-controller.html | 10 + alexa/alexa-home-controller.js | 96 +++-- alexa/alexa-home.js | 14 +- alexa/alexa-hub.js | 24 +- docker-package.json | 2 +- package-lock.json | 639 ++++++++++++------------------- package.json | 12 +- test/controller_spec.js | 2 +- 10 files changed, 360 insertions(+), 456 deletions(-) diff --git a/Dockerfile b/Dockerfile index 783ef03..70e6f95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,5 +11,5 @@ RUN npm install ## link dev code RUN npm link /usr/src/alexa-node/ -USER node-red +# USER node-red diff --git a/alexa/alexa-helper.js b/alexa/alexa-helper.js index f29a522..ecb1f39 100644 --- a/alexa/alexa-helper.js +++ b/alexa/alexa-helper.js @@ -1,18 +1,15 @@ 'use strict'; module.exports = { - hubPort: ( process.env.ALEXA_PORT != undefined - && + hubPort: ( process.env.ALEXA_PORT != undefined && parseInt(process.env.ALEXA_PORT) - ) - || 60000, + ) || + 60000, controllerNode: undefined, - isDebug: ( process.env.DEBUG - && + isDebug: ( process.env.DEBUG && process.env.DEBUG.indexOf('node-red-contrib-alexa-home') > 0 - ) - || false, + ) || + false, bri_default: process.env.BRI_DEFAULT || 254, - maxItemCount: 20, prefixUUID: 'f6543a06-da50-11ba-8d8f-', }; diff --git a/alexa/alexa-home-controller.html b/alexa/alexa-home-controller.html index a54a62e..37ed9fc 100644 --- a/alexa/alexa-home-controller.html +++ b/alexa/alexa-home-controller.html @@ -9,6 +9,11 @@ Port +
+ + +