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 +}; +