From 3a8dd1b577452b87b8ae280528849c094e827c81 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Tue, 9 Jan 2018 17:40:11 +0100 Subject: [PATCH] typescriptifying completed --- {src => dist}/Forwarder.js | 20 +++-- .../HomematicDimmerItem.js | 32 ++++---- {src => dist}/HomematicSwitchItem.js | 34 ++++----- {src => dist}/TimerAdaptor.js | 36 ++++----- dist/main.js | 15 ++++ src/AItem.ts | 2 +- src/DimmerAdaptor.ts | 2 +- src/Forwarder.ts | 26 +++++++ src/HomematicDimmerItem.ts | 76 +++++++++++++++++++ src/HomematicSwitchItem.ts | 54 +++++++++++++ src/TimerAdaptor.ts | 56 ++++++++++++++ src/main.js | 53 ------------- src/main.ts | 36 +++++++-- 13 files changed, 315 insertions(+), 127 deletions(-) rename {src => dist}/Forwarder.js (51%) rename src/homematicDimmerItem.js => dist/HomematicDimmerItem.js (70%) rename {src => dist}/HomematicSwitchItem.js (56%) rename {src => dist}/TimerAdaptor.js (57%) create mode 100644 src/Forwarder.ts create mode 100644 src/HomematicDimmerItem.ts create mode 100644 src/HomematicSwitchItem.ts create mode 100644 src/TimerAdaptor.ts delete mode 100644 src/main.js diff --git a/src/Forwarder.js b/dist/Forwarder.js similarity index 51% rename from src/Forwarder.js rename to dist/Forwarder.js index 452e71e..047531e 100644 --- a/src/Forwarder.js +++ b/dist/Forwarder.js @@ -1,25 +1,23 @@ -let AItem = require('./AItem') -let logger = require('./log') -let mqtt = require('./mqttHandler'); - - -class Forwarder extends AItem { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const AItem_1 = require("./AItem"); +const MqttDispatcher_1 = require("./MqttDispatcher"); +class Forwarder extends AItem_1.AItem { constructor(floor, room, item, topicLastPart, targetTopics) { super(floor, room, item); this.inTopic = `${this.topicFirstPart}/${topicLastPart}`; - this.subscribeTopics = [ this.inTopic ]; + this.subscribeTopics = [this.inTopic]; this.targetTopics = targetTopics; } - processMessage(topic, payload) { switch (topic) { case this.inTopic: this.targetTopics.forEach((targetTopic) => { - mqtt.send(targetTopic, payload, true); + MqttDispatcher_1.mqttHandler.send(targetTopic, payload, true); }); break; } } } - -module.exports = Forwarder; +exports.Forwarder = Forwarder; +//# sourceMappingURL=Forwarder.js.map \ No newline at end of file diff --git a/src/homematicDimmerItem.js b/dist/HomematicDimmerItem.js similarity index 70% rename from src/homematicDimmerItem.js rename to dist/HomematicDimmerItem.js index 58903f4..3c813b4 100644 --- a/src/homematicDimmerItem.js +++ b/dist/HomematicDimmerItem.js @@ -1,9 +1,9 @@ -let logger = require('./log'); -let mqtt = require('./mqttHandler'); -let AHomematicItem = require('./AHomematicItem') - - -class HomematicDimmerItem extends AHomematicItem { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const logger = require("./log"); +const MqttDispatcher_1 = require("./MqttDispatcher"); +const AHomematicItem_1 = require("./AHomematicItem"); +class HomematicDimmerItem extends AHomematicItem_1.AHomematicItem { constructor(floor, room, item, hmId) { super(floor, room, item, hmId); this.stateTopic = `${this.topicFirstPart}/state`; @@ -26,29 +26,28 @@ class HomematicDimmerItem extends AHomematicItem { this.bright = 0.0; this.oldBright = undefined; } - dimmerAction() { - if ((this.state != this.oldState) || (this.bright != this.oldBright)) { + if ((this.state != this.oldState) || (this.bright != this.oldBright)) { if (this.state == 'ON') { - mqtt.send(this.actionTopic, `${this.bright / 100.0}`); - } else { - mqtt.send(this.actionTopic, '0'); + MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${this.bright / 100.0}`); + } + else { + MqttDispatcher_1.mqttHandler.send(this.actionTopic, '0'); } this.oldState = this.state; this.oldBright = this.bright; } } - processMessage(topic, payload) { switch (topic) { case this.stateTopic: this.state = payload; - mqtt.send(this.stateFeedbackTopic, this.state); + MqttDispatcher_1.mqttHandler.send(this.stateFeedbackTopic, this.state); this.dimmerAction(); break; case this.brightTopic: this.bright = parseFloat(payload); - mqtt.send(this.brightFeedbackTopic, `${this.bright}`); + MqttDispatcher_1.mqttHandler.send(this.brightFeedbackTopic, `${this.bright}`); this.dimmerAction(); break; case this.errorOverheatTopic: @@ -61,6 +60,5 @@ class HomematicDimmerItem extends AHomematicItem { } } } - -module.exports = HomematicDimmerItem; - +exports.HomematicDimmerItem = HomematicDimmerItem; +//# sourceMappingURL=HomematicDimmerItem.js.map \ No newline at end of file diff --git a/src/HomematicSwitchItem.js b/dist/HomematicSwitchItem.js similarity index 56% rename from src/HomematicSwitchItem.js rename to dist/HomematicSwitchItem.js index 19497c5..d464125 100644 --- a/src/HomematicSwitchItem.js +++ b/dist/HomematicSwitchItem.js @@ -1,9 +1,8 @@ -let logger = require('./log'); -let mqtt = require('./mqttHandler'); -let AHomematicItem = require('./AHomematicItem') - - -class HomematicSwitchItem extends AHomematicItem { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const MqttDispatcher_1 = require("./MqttDispatcher"); +const AHomematicItem_1 = require("./AHomematicItem"); +class HomematicSwitchItem extends AHomematicItem_1.AHomematicItem { constructor(floor, room, item, hmId) { super(floor, room, item, hmId); this.stateTopic = `${this.topicFirstPart}/state`; @@ -17,18 +16,17 @@ class HomematicSwitchItem extends AHomematicItem { this.state = 'OFF'; this.oldState = undefined; } - - processMessage(topic, payload) { switch (topic) { case this.stateTopic: this.state = payload; - mqtt.send(this.stateFeedbackTopic, this.state); - if (this.state != this.oldState) { + MqttDispatcher_1.mqttHandler.send(this.stateFeedbackTopic, this.state); + if (this.state != this.oldState) { if (this.state == 'ON') { - mqtt.send(this.actionTopic, 'true'); - } else { - mqtt.send(this.actionTopic, 'false'); + MqttDispatcher_1.mqttHandler.send(this.actionTopic, 'true'); + } + else { + MqttDispatcher_1.mqttHandler.send(this.actionTopic, 'false'); } this.oldState = this.state; } @@ -36,15 +34,15 @@ class HomematicSwitchItem extends AHomematicItem { case this.deviceFeedbackTopic: if (payload == 'true') { this.state = 'ON'; - } else { + } + else { this.state = 'OFF'; } this.oldState = this.state; - mqtt.send(this.stateFeedbackTopic, this.state); + MqttDispatcher_1.mqttHandler.send(this.stateFeedbackTopic, this.state); break; } } } - -module.exports = HomematicSwitchItem; - +exports.HomematicSwitchItem = HomematicSwitchItem; +//# sourceMappingURL=HomematicSwitchItem.js.map \ No newline at end of file diff --git a/src/TimerAdaptor.js b/dist/TimerAdaptor.js similarity index 57% rename from src/TimerAdaptor.js rename to dist/TimerAdaptor.js index f230a87..0093214 100644 --- a/src/TimerAdaptor.js +++ b/dist/TimerAdaptor.js @@ -1,19 +1,18 @@ -let AItem = require('./AItem') -let logger = require('./log') -let mqtt = require('./mqttHandler'); - - -class TimerAdaptor extends AItem { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const AItem_1 = require("./AItem"); +const logger = require("./log"); +const MqttDispatcher_1 = require("./MqttDispatcher"); +class TimerAdaptor extends AItem_1.AItem { constructor(floor, room, item, delay) { super(floor, room, item); this.actionStateTopic = `${this.topicFirstPart}/state`; this.inTopic = `${this.topicFirstPart}/timerIn`; - this.subscribeTopics = [ this.inTopic ]; + this.subscribeTopics = [this.inTopic]; this.state = 'OFF'; this.delay = delay; this.timer = null; } - processMessage(topic, payload) { switch (topic) { case this.inTopic: @@ -23,28 +22,29 @@ class TimerAdaptor extends AItem { clearTimeout(this.timer); } this.state = 'ON'; - mqtt.send(this.actionStateTopic, this.state, true); + MqttDispatcher_1.mqttHandler.send(this.actionStateTopic, this.state, true); this.timer = setTimeout(() => { logger.info(`timer ${this.itemId} elapsed`); this.state = 'OFF'; - mqtt.send(this.actionStateTopic, this.state, true); + MqttDispatcher_1.mqttHandler.send(this.actionStateTopic, this.state, true); }, (this.delay * 1000)); break; case 'LONG_END': - clearTimeout(this.timer); + if (this.timer != null) { + clearTimeout(this.timer); + } if (this.state == 'OFF') { this.state = 'ON'; - } else { + } + else { this.state = 'OFF'; } - mqtt.send(this.actionStateTopic, this.state, true); + MqttDispatcher_1.mqttHandler.send(this.actionStateTopic, this.state, true); break; - } + } break; } } } - - -module.exports = TimerAdaptor; - +exports.TimerAdaptor = TimerAdaptor; +//# sourceMappingURL=TimerAdaptor.js.map \ No newline at end of file diff --git a/dist/main.js b/dist/main.js index 7d3ebd9..8aff916 100644 --- a/dist/main.js +++ b/dist/main.js @@ -5,6 +5,10 @@ const MqttDispatcher_1 = require("./MqttDispatcher"); const M433SwitchItem_1 = require("./M433SwitchItem"); const HomematicFourButtonThing_1 = require("./HomematicFourButtonThing"); const DimmerAdaptor_1 = require("./DimmerAdaptor"); +const TimerAdaptor_1 = require("./TimerAdaptor"); +const HomematicDimmerItem_1 = require("./HomematicDimmerItem"); +const HomematicSwitchItem_1 = require("./HomematicSwitchItem"); +const Forwarder_1 = require("./Forwarder"); logger.info("Dispatcher starting"); let aquariumLight = new M433SwitchItem_1.M433SwitchItem('1st', 'Anna', 'AquariumLight', '14665044 24 1', '14665041 24 1'); aquariumLight.start(); @@ -19,6 +23,17 @@ let testFourButton = new HomematicFourButtonThing_1.HomematicFourButtonThing('Gn testFourButton.start(); let testDimmerAdaptor = new DimmerAdaptor_1.DimmerAdaptor('Gnd', 'Hallway', 'Testlight'); testDimmerAdaptor.start(); +let testTimerAdaptor = new TimerAdaptor_1.TimerAdaptor('Gnd', 'Hallway', 'DeskLight', 10); +testTimerAdaptor.start(); +let testLight = new HomematicDimmerItem_1.HomematicDimmerItem('Gnd', 'Hallway', 'Testlight', 8); +testLight.start(); +let testLight2 = new HomematicSwitchItem_1.HomematicSwitchItem('Gnd', 'Hallway', 'Testlight2', 5); +testLight2.start(); +let testForwarder = new Forwarder_1.Forwarder('Gnd', 'Hallway', 'TestForwarder', 'state', [ + 'dispatcher_ng/items/Gnd/Hallway/Testlight2/state', + 'dispatcher_ng/items/Gnd/Hallway/DeskLight/state' +]); +testForwarder.start(); MqttDispatcher_1.mqttHandler.exec(); logger.info("Dispatcher running"); //# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/src/AItem.ts b/src/AItem.ts index 5b1b251..a7bd0d4 100644 --- a/src/AItem.ts +++ b/src/AItem.ts @@ -4,7 +4,7 @@ import { mqttHandler } from './MqttDispatcher' export abstract class AItem { protected topicFirstPart: string; - private itemId: string; + protected itemId: string; private item: string; private room: string; private floor: string diff --git a/src/DimmerAdaptor.ts b/src/DimmerAdaptor.ts index 2df6075..89f479b 100644 --- a/src/DimmerAdaptor.ts +++ b/src/DimmerAdaptor.ts @@ -22,7 +22,7 @@ export class DimmerAdaptor extends AItem { this.brightDirection = -1 } - processMessage(topic: string, payload: string) { + processMessage(topic: string, payload: string) : void { switch (topic) { case this.inTopic: switch (payload) { diff --git a/src/Forwarder.ts b/src/Forwarder.ts new file mode 100644 index 0000000..144ebb0 --- /dev/null +++ b/src/Forwarder.ts @@ -0,0 +1,26 @@ +import { AItem } from './AItem' +import * as logger from './log' +import { mqttHandler } from './MqttDispatcher' + + +export class Forwarder extends AItem { + private targetTopics: string[] + private inTopic: string + + constructor(floor: string, room: string, item: string, topicLastPart: string, targetTopics: string[]) { + super(floor, room, item) + this.inTopic = `${this.topicFirstPart}/${topicLastPart}` + this.subscribeTopics = [ this.inTopic ] + this.targetTopics = targetTopics + } + + processMessage(topic: string, payload: string) : void { + switch (topic) { + case this.inTopic: + this.targetTopics.forEach((targetTopic) => { + mqttHandler.send(targetTopic, payload, true) + }) + break + } + } +} diff --git a/src/HomematicDimmerItem.ts b/src/HomematicDimmerItem.ts new file mode 100644 index 0000000..4e5a16d --- /dev/null +++ b/src/HomematicDimmerItem.ts @@ -0,0 +1,76 @@ +import * as logger from './log' +import { mqttHandler } from './MqttDispatcher' +import { AHomematicItem } from './AHomematicItem' + + +export class HomematicDimmerItem extends AHomematicItem { + private oldBright: number|undefined + private bright: number + private oldState: string|undefined + private state: string + private errorReducedTopic: string + private errorOverloadTopic: string + private errorOverheatTopic: string + private actionTopic: string + private brightFeedbackTopic: string + private stateFeedbackTopic: string + private brightTopic: string + private stateTopic: string + + constructor(floor: string, room: string, item: string, hmId: number) { + super(floor, room, item, hmId) + this.stateTopic = `${this.topicFirstPart}/state` + this.brightTopic = `${this.topicFirstPart}/bright` + this.stateFeedbackTopic = `${this.topicFirstPart}/state/feedback` + this.brightFeedbackTopic = `${this.topicFirstPart}/bright/feedback` + this.actionTopic = `${this.actionTopicPre}/1/LEVEL` + this.errorOverheatTopic = `${this.deviceTopicPre}/1/ERROR_OVERHEAT` + this.errorOverloadTopic = `${this.deviceTopicPre}/1/ERROR_OVERLOAD` + this.errorReducedTopic = `${this.deviceTopicPre}/1/ERROR_REDUCED` + this.subscribeTopics = [ + this.stateTopic, + this.brightTopic, + this.errorOverheatTopic, + this.errorOverloadTopic, + this.errorReducedTopic + ] + this.state = 'OFF' + this.oldState = undefined + this.bright = 0.0 + this.oldBright = undefined + } + + dimmerAction() : void { + if ((this.state != this.oldState) || (this.bright != this.oldBright)) { + if (this.state == 'ON') { + mqttHandler.send(this.actionTopic, `${this.bright / 100.0}`) + } else { + mqttHandler.send(this.actionTopic, '0') + } + this.oldState = this.state + this.oldBright = this.bright + } + } + + processMessage(topic: string, payload: string) : void { + switch (topic) { + case this.stateTopic: + this.state = payload + mqttHandler.send(this.stateFeedbackTopic, this.state) + this.dimmerAction() + break + case this.brightTopic: + this.bright = parseFloat(payload) + mqttHandler.send(this.brightFeedbackTopic, `${this.bright}`) + this.dimmerAction() + break + case this.errorOverheatTopic: + case this.errorOverloadTopic: + case this.errorReducedTopic: + if (payload != 'false') { + logger.warn(`Homematic dimmer ${this.hmId}, ${this.itemId} reports: ${topic}: ${payload}`) + } + break + } + } +} diff --git a/src/HomematicSwitchItem.ts b/src/HomematicSwitchItem.ts new file mode 100644 index 0000000..2ff1667 --- /dev/null +++ b/src/HomematicSwitchItem.ts @@ -0,0 +1,54 @@ +import * as logger from './log' +import { mqttHandler } from './MqttDispatcher' +import { AHomematicItem } from './AHomematicItem' + + +export class HomematicSwitchItem extends AHomematicItem { + private oldState: string|undefined + private state: string + private actionTopic: string + private deviceFeedbackTopic: string + private stateFeedbackTopic: string + private stateTopic: string + + constructor(floor: string, room: string, item: string, hmId: number) { + super(floor, room, item, hmId) + this.stateTopic = `${this.topicFirstPart}/state` + this.stateFeedbackTopic = `${this.topicFirstPart}/state/feedback` + this.deviceFeedbackTopic = `${this.deviceTopicPre}/1/STATE` + this.actionTopic = `${this.actionTopicPre}/1/STATE` + this.subscribeTopics = [ + this.stateTopic, + this.deviceFeedbackTopic + ] + this.state = 'OFF' + this.oldState = undefined + } + + + processMessage(topic: string, payload: string) : void { + switch (topic) { + case this.stateTopic: + this.state = payload + mqttHandler.send(this.stateFeedbackTopic, this.state) + if (this.state != this.oldState) { + if (this.state == 'ON') { + mqttHandler.send(this.actionTopic, 'true') + } else { + mqttHandler.send(this.actionTopic, 'false') + } + this.oldState = this.state + } + break + case this.deviceFeedbackTopic: + if (payload == 'true') { + this.state = 'ON' + } else { + this.state = 'OFF' + } + this.oldState = this.state + mqttHandler.send(this.stateFeedbackTopic, this.state) + break + } + } +} diff --git a/src/TimerAdaptor.ts b/src/TimerAdaptor.ts new file mode 100644 index 0000000..6fdc5fe --- /dev/null +++ b/src/TimerAdaptor.ts @@ -0,0 +1,56 @@ +import { AItem } from './AItem' +import * as logger from './log' +import { mqttHandler } from './MqttDispatcher' + + + +export class TimerAdaptor extends AItem { + private timer: NodeJS.Timer|null + private delay: number + private state: string + private inTopic: string + private actionStateTopic: string + + constructor(floor: string, room: string, item: string, delay: number) { + super(floor, room, item) + this.actionStateTopic = `${this.topicFirstPart}/state` + this.inTopic = `${this.topicFirstPart}/timerIn` + this.subscribeTopics = [ this.inTopic ] + this.state = 'OFF' + this.delay = delay + this.timer = null + } + + processMessage(topic: string, payload: string) : void { + switch (topic) { + case this.inTopic: + switch (payload) { + case 'SHORT': + if ((this.state == 'ON') && (this.timer != null)) { + clearTimeout(this.timer) + } + this.state = 'ON' + mqttHandler.send(this.actionStateTopic, this.state, true) + this.timer = setTimeout(() => { + logger.info(`timer ${this.itemId} elapsed`) + this.state = 'OFF' + mqttHandler.send(this.actionStateTopic, this.state, true) + }, (this.delay * 1000)) + break + case 'LONG_END': + if (this.timer != null) { + clearTimeout(this.timer) + } + if (this.state == 'OFF') { + this.state = 'ON' + } else { + this.state = 'OFF' + } + mqttHandler.send(this.actionStateTopic, this.state, true) + break + } + break + } + } +} + diff --git a/src/main.js b/src/main.js deleted file mode 100644 index 5662138..0000000 --- a/src/main.js +++ /dev/null @@ -1,53 +0,0 @@ -let logger = require('./log'); -let mqtt = require('./mqttHandler'); - -let HomematicDimmerItemClass = require('./HomematicDimmerItem'); -let HomematicSwitchItemClass = require('./HomematicSwitchItem'); -let M433SwitchItem = require('./M433SwitchItem'); -let HomematicFourButtonThing = require('./HomematicFourButtonThing'); -let HomematicFourButtonSingleItem = require('./HomematicFourButtonSingleItem'); -let DimmerAdaptor = require('./DimmerAdaptor'); -let TimerAdaptor = require('./TimerAdaptor'); -let Forwarder = require('./Forwarder'); - - - - - - -let aquariumLight = new M433SwitchItem('1st', 'Anna', 'AquariumLight', '14665044 24 1', '14665041 24 1'); -aquariumLight.start(); - -let deskLight = new M433SwitchItem('Gnd', 'Hallway', 'DeskLight', '83221 24 1', '83220 24 1'); -deskLight.start(); - -let testFourButton = new HomematicFourButtonThing('Gnd', 'Hallway', 'TestButton', 9, [ - new HomematicFourButtonSingleItem('button1', 'dispatcher_ng/items/Gnd/Hallway/Testlight/dimmerIn'), - new HomematicFourButtonSingleItem('button2', 'dispatcher_ng/items/Gnd/Hallway/DeskLight/timerIn'), - new HomematicFourButtonSingleItem('button3', 'test/button/3'), - new HomematicFourButtonSingleItem('button4', 'test/button/4') -]); -testFourButton.start(); - -let testDimmerAdaptor = new DimmerAdaptor('Gnd', 'Hallway', 'Testlight'); -testDimmerAdaptor.start(); - -let testTimerAdaptor = new TimerAdaptor('Gnd', 'Hallway', 'DeskLight', 10); -testTimerAdaptor.start(); - -let testLight = new HomematicDimmerItemClass('Gnd', 'Hallway', 'Testlight', 8); -testLight.start(); - -let testLight2 = new HomematicSwitchItemClass('Gnd', 'Hallway', 'Testlight2', 5); -testLight2.start(); - -let testForwarder = new Forwarder('Gnd', 'Hallway', 'TestForwarder', 'state', [ - 'dispatcher_ng/items/Gnd/Hallway/Testlight2/state', - 'dispatcher_ng/items/Gnd/Hallway/DeskLight/state' -]); -testForwarder.start(); - - - - -mqtt.start(); diff --git a/src/main.ts b/src/main.ts index 2d8faa0..b04a516 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,26 +5,46 @@ import { mqttHandler } from './MqttDispatcher' import { M433SwitchItem } from './M433SwitchItem' import { HomematicFourButtonThing, HomematicFourButtonSingleItem } from './HomematicFourButtonThing' import { DimmerAdaptor } from './DimmerAdaptor' +import { TimerAdaptor } from './TimerAdaptor' +import { HomematicDimmerItem } from './HomematicDimmerItem' +import { HomematicSwitchItem } from './HomematicSwitchItem' +import { Forwarder } from './Forwarder' + logger.info("Dispatcher starting") -let aquariumLight = new M433SwitchItem('1st', 'Anna', 'AquariumLight', '14665044 24 1', '14665041 24 1'); -aquariumLight.start(); +let aquariumLight = new M433SwitchItem('1st', 'Anna', 'AquariumLight', '14665044 24 1', '14665041 24 1') +aquariumLight.start() -let deskLight = new M433SwitchItem('Gnd', 'Hallway', 'DeskLight', '83221 24 1', '83220 24 1'); -deskLight.start(); +let deskLight = new M433SwitchItem('Gnd', 'Hallway', 'DeskLight', '83221 24 1', '83220 24 1') +deskLight.start() let testFourButton = new HomematicFourButtonThing('Gnd', 'Hallway', 'TestButton', 9, [ new HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/Testlight/dimmerIn'), new HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/DeskLight/timerIn'), new HomematicFourButtonSingleItem('test/button/3'), new HomematicFourButtonSingleItem('test/button/4') -]); -testFourButton.start(); +]) +testFourButton.start() -let testDimmerAdaptor = new DimmerAdaptor('Gnd', 'Hallway', 'Testlight'); -testDimmerAdaptor.start(); +let testDimmerAdaptor = new DimmerAdaptor('Gnd', 'Hallway', 'Testlight') +testDimmerAdaptor.start() + +let testTimerAdaptor = new TimerAdaptor('Gnd', 'Hallway', 'DeskLight', 10) +testTimerAdaptor.start() + +let testLight = new HomematicDimmerItem('Gnd', 'Hallway', 'Testlight', 8) +testLight.start() + +let testLight2 = new HomematicSwitchItem('Gnd', 'Hallway', 'Testlight2', 5) +testLight2.start() + +let testForwarder = new Forwarder('Gnd', 'Hallway', 'TestForwarder', 'state', [ + 'dispatcher_ng/items/Gnd/Hallway/Testlight2/state', + 'dispatcher_ng/items/Gnd/Hallway/DeskLight/state' +]) +testForwarder.start()