diff --git a/dist/Forwarder.js b/dist/Forwarder.js index ffd16fc..e990c0d 100644 --- a/dist/Forwarder.js +++ b/dist/Forwarder.js @@ -3,7 +3,7 @@ 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, label, topicLastPart, targetTopics) { + constructor(floor, room, item, topicLastPart, label, targetTopics) { super(floor, room, item, label); this.inTopic = `${this.topicFirstPart}/${topicLastPart}`; this.subscribeTopics = [this.inTopic]; diff --git a/dist/main.js b/dist/main.js index 73c00ca..f185fe2 100644 --- a/dist/main.js +++ b/dist/main.js @@ -100,6 +100,41 @@ allLabeledItems.push(bedRoomPattysSide); let bedRoomWindowLight = new M433SwitchItem_1.M433SwitchItem('1st', 'BedRoom', 'WindowLight', 'Fensterbanklicht Schlafzimmer', '13979988 24 1', '13979985 24 1'); bedRoomWindowLight.start(); allLabeledItems.push(bedRoomWindowLight); +// --------------------------------------------------------------------------------------------------------- +let morningLightForwarder = new Forwarder_1.Forwarder('Gnd', 'Hallway', 'MorningLight', 'state', 'MorningLight', [ + kitchenWindowLight.stateTopic, + kitchenCeilingLight.stateTopic, + hallwayDeskLight.stateTopic, + hallwayStandLight.stateTopic, + hallwayWardrobeLight.stateTopic +]); +morningLightForwarder.start(); +let dayLightForwarder = new Forwarder_1.Forwarder('Gnd', 'Hallway', 'DayLight', 'state', 'DayLight', [ + kitchenWindowLight.stateTopic, + kitchenCeilingLight.stateTopic, + hallwayDeskLight.stateTopic, + hallwayStandLight.stateTopic, + hallwayWardrobeLight.stateTopic, + diningRoomSmallLight.stateTopic, + diningRoomStandLight.stateTopic, + diningRoomCupboardLight.stateTopic, + livingRoomLargeLight.stateTopic, + livingRoomSmallLight.stateTopic, + livingRoomStars.stateTopic, + livingRoomStandLight.stateTopic +]); +dayLightForwarder.start(); +let ecoLightForwarder = new Forwarder_1.Forwarder('Gnd', 'Hallway', 'EcoLight', 'state', 'EcoLight', [ + kitchenWindowLight.stateTopic, + hallwayDeskLight.stateTopic, + hallwayWardrobeLight.stateTopic, + diningRoomSmallLight.stateTopic, + diningRoomStandLight.stateTopic, + diningRoomCupboardLight.stateTopic, + livingRoomStars.stateTopic, + livingRoomStandLight.stateTopic +]); +ecoLightForwarder.start(); // ---------------------------------------------------------------------------------------------------------- let testFourButton = new HomematicFourButtonThing_1.HomematicFourButtonThing('Gnd', 'Hallway', 'TestButton', 9, [ new HomematicFourButtonThing_1.HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/Testlight/dimmerIn'), diff --git a/src/Forwarder.ts b/src/Forwarder.ts index 5a74f40..5b14453 100644 --- a/src/Forwarder.ts +++ b/src/Forwarder.ts @@ -7,7 +7,7 @@ export class Forwarder extends AItem { private targetTopics: string[] private inTopic: string - constructor(floor: string, room: string, item: string, label: string, topicLastPart: string, targetTopics: string[]) { + constructor(floor: string, room: string, item: string, topicLastPart: string, label: string, targetTopics: string[]) { super(floor, room, item, label) this.inTopic = `${this.topicFirstPart}/${topicLastPart}` this.subscribeTopics = [ this.inTopic ] diff --git a/src/M433SwitchItem.ts b/src/M433SwitchItem.ts index 755223f..da88210 100644 --- a/src/M433SwitchItem.ts +++ b/src/M433SwitchItem.ts @@ -11,7 +11,7 @@ export class M433SwitchItem extends AItem { private state: string private actionTopic: string private stateFeedbackTopic: string - private stateTopic: string + public stateTopic: string private type: string constructor(floor: string, room: string, item: string, label: string, onCode: string, offCode: string, type: string = 'bulb') { diff --git a/src/main.ts b/src/main.ts index a574405..647405d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -132,6 +132,43 @@ bedRoomWindowLight.start() allLabeledItems.push(bedRoomWindowLight) +// --------------------------------------------------------------------------------------------------------- +let morningLightForwarder = new Forwarder('Gnd', 'Hallway', 'MorningLight', 'state', 'MorningLight', [ + kitchenWindowLight.stateTopic, + kitchenCeilingLight.stateTopic, + hallwayDeskLight.stateTopic, + hallwayStandLight.stateTopic, + hallwayWardrobeLight.stateTopic +]) +morningLightForwarder.start() + +let dayLightForwarder = new Forwarder('Gnd', 'Hallway', 'DayLight', 'state', 'DayLight', [ + kitchenWindowLight.stateTopic, + kitchenCeilingLight.stateTopic, + hallwayDeskLight.stateTopic, + hallwayStandLight.stateTopic, + hallwayWardrobeLight.stateTopic, + diningRoomSmallLight.stateTopic, + diningRoomStandLight.stateTopic, + diningRoomCupboardLight.stateTopic, + livingRoomLargeLight.stateTopic, + livingRoomSmallLight.stateTopic, + livingRoomStars.stateTopic, + livingRoomStandLight.stateTopic +]) +dayLightForwarder.start() + +let ecoLightForwarder = new Forwarder('Gnd', 'Hallway', 'EcoLight', 'state', 'EcoLight', [ + kitchenWindowLight.stateTopic, + hallwayDeskLight.stateTopic, + hallwayWardrobeLight.stateTopic, + diningRoomSmallLight.stateTopic, + diningRoomStandLight.stateTopic, + diningRoomCupboardLight.stateTopic, + livingRoomStars.stateTopic, + livingRoomStandLight.stateTopic +]) +ecoLightForwarder.start() // ---------------------------------------------------------------------------------------------------------- let testFourButton = new HomematicFourButtonThing('Gnd', 'Hallway', 'TestButton', 9, [ new HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/Testlight/dimmerIn'),