some forwarders

This commit is contained in:
Wolfgang Hottgenroth
2018-01-10 21:46:15 +01:00
parent 1327878985
commit f430ab5ff0
5 changed files with 75 additions and 3 deletions

2
dist/Forwarder.js vendored
View File

@ -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];

35
dist/main.js vendored
View File

@ -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'),

View File

@ -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 ]

View File

@ -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') {

View File

@ -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'),