From e16a8f77a4b855c0e7158fa35eb7c9617e33f1db Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Sun, 7 Jan 2018 21:00:26 +0100 Subject: [PATCH] new --- src/RelayBox.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/RelayBox.js diff --git a/src/RelayBox.js b/src/RelayBox.js new file mode 100644 index 0000000..49e5acb --- /dev/null +++ b/src/RelayBox.js @@ -0,0 +1,28 @@ +let mqtt = require('./mqttHandler'); +let logger = require('./log'); + + + +class Switch { + +} + +class RelayBox { + constructor(switches) { + this.switches = switches; + + } + + start() { + mqtt.register(this.subscribeTopics, (topic, payload) => { + logger.info(`item ${this.itemId}: ${topic}, ${payload}`) + this.processMessage(topic, payload); + }); + } +} + +module.exports = { + RelayBox, + Switch +}; +