Merge branch 'TypescriptIntro' of ssh://gitlab.com/wolutator/dispatcher_ng into TypescriptIntro
This commit is contained in:
2
dist/Forwarder.js
vendored
2
dist/Forwarder.js
vendored
@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
const AItem_1 = require("./AItem");
|
const AItem_1 = require("./AItem");
|
||||||
const MqttDispatcher_1 = require("./MqttDispatcher");
|
const MqttDispatcher_1 = require("./MqttDispatcher");
|
||||||
class Forwarder extends AItem_1.AItem {
|
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);
|
super(floor, room, item, label);
|
||||||
this.inTopic = `${this.topicFirstPart}/${topicLastPart}`;
|
this.inTopic = `${this.topicFirstPart}/${topicLastPart}`;
|
||||||
this.subscribeTopics = [this.inTopic];
|
this.subscribeTopics = [this.inTopic];
|
||||||
|
39
dist/main.js
vendored
39
dist/main.js
vendored
@ -75,7 +75,7 @@ let hallwayStandLight = new M433SwitchItem_1.M433SwitchItem('Gnd', 'Hallway', 'S
|
|||||||
hallwayStandLight.start();
|
hallwayStandLight.start();
|
||||||
allLabeledItems.push(hallwayStandLight);
|
allLabeledItems.push(hallwayStandLight);
|
||||||
// Flur Schranklicht 66581 24 1 66580 24 1
|
// Flur Schranklicht 66581 24 1 66580 24 1
|
||||||
let hallwayWardrobeLight = new M433SwitchItem_1.M433SwitchItem('Gnd', 'Hallway', 'StandLight', 'Schranklicht Flur', '66581 24 1', '66580 24 1');
|
let hallwayWardrobeLight = new M433SwitchItem_1.M433SwitchItem('Gnd', 'Hallway', 'WardrobeLight', 'Schranklicht Flur', '66581 24 1', '66580 24 1');
|
||||||
hallwayWardrobeLight.start();
|
hallwayWardrobeLight.start();
|
||||||
allLabeledItems.push(hallwayWardrobeLight);
|
allLabeledItems.push(hallwayWardrobeLight);
|
||||||
// Küche ----------------------------------------------------------------------------------------------------
|
// Küche ----------------------------------------------------------------------------------------------------
|
||||||
@ -85,7 +85,7 @@ kitchenWindowLight.start();
|
|||||||
allLabeledItems.push(kitchenWindowLight);
|
allLabeledItems.push(kitchenWindowLight);
|
||||||
// Küche Deckenlampe 82197 24 1 82196 24 1
|
// Küche Deckenlampe 82197 24 1 82196 24 1
|
||||||
let kitchenCeilingLight = new M433SwitchItem_1.M433SwitchItem('Gnd', 'Kitchen', 'CeilingLight', 'Deckenlampe Küche', '82197 24 1', '82196 24 1');
|
let kitchenCeilingLight = new M433SwitchItem_1.M433SwitchItem('Gnd', 'Kitchen', 'CeilingLight', 'Deckenlampe Küche', '82197 24 1', '82196 24 1');
|
||||||
kitchenWindowLight.start();
|
kitchenCeilingLight.start();
|
||||||
allLabeledItems.push(kitchenCeilingLight);
|
allLabeledItems.push(kitchenCeilingLight);
|
||||||
// Schlafzimmer ---------------------------------------------------------------------------------------------
|
// Schlafzimmer ---------------------------------------------------------------------------------------------
|
||||||
// Schlafzimmer Wolfgangs Seite 13976916 24 1 13976913 24 1
|
// Schlafzimmer Wolfgangs Seite 13976916 24 1 13976913 24 1
|
||||||
@ -100,6 +100,41 @@ allLabeledItems.push(bedRoomPattysSide);
|
|||||||
let bedRoomWindowLight = new M433SwitchItem_1.M433SwitchItem('1st', 'BedRoom', 'WindowLight', 'Fensterbanklicht Schlafzimmer', '13979988 24 1', '13979985 24 1');
|
let bedRoomWindowLight = new M433SwitchItem_1.M433SwitchItem('1st', 'BedRoom', 'WindowLight', 'Fensterbanklicht Schlafzimmer', '13979988 24 1', '13979985 24 1');
|
||||||
bedRoomWindowLight.start();
|
bedRoomWindowLight.start();
|
||||||
allLabeledItems.push(bedRoomWindowLight);
|
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, [
|
let testFourButton = new HomematicFourButtonThing_1.HomematicFourButtonThing('Gnd', 'Hallway', 'TestButton', 9, [
|
||||||
new HomematicFourButtonThing_1.HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/Testlight/dimmerIn'),
|
new HomematicFourButtonThing_1.HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/Testlight/dimmerIn'),
|
||||||
|
19
homekit.json
19
homekit.json
@ -219,7 +219,7 @@
|
|||||||
},
|
},
|
||||||
"Gnd.Hallway.StandLight": {
|
"Gnd.Hallway.StandLight": {
|
||||||
"id": "Gnd.Hallway.StandLight",
|
"id": "Gnd.Hallway.StandLight",
|
||||||
"name": "Schranklicht Flur",
|
"name": "Stehlampe Flur",
|
||||||
"service": "Lightbulb",
|
"service": "Lightbulb",
|
||||||
"topic": {
|
"topic": {
|
||||||
"setOn": "dispatcher_ng/items/Gnd/Hallway/StandLight/state",
|
"setOn": "dispatcher_ng/items/Gnd/Hallway/StandLight/state",
|
||||||
@ -234,6 +234,23 @@
|
|||||||
},
|
},
|
||||||
"config": {}
|
"config": {}
|
||||||
},
|
},
|
||||||
|
"Gnd.Hallway.WardrobeLight": {
|
||||||
|
"id": "Gnd.Hallway.WardrobeLight",
|
||||||
|
"name": "Schranklicht Flur",
|
||||||
|
"service": "Lightbulb",
|
||||||
|
"topic": {
|
||||||
|
"setOn": "dispatcher_ng/items/Gnd/Hallway/WardrobeLight/state",
|
||||||
|
"statusOn": "dispatcher_ng/items/Gnd/Hallway/WardrobeLight/state/feedback"
|
||||||
|
},
|
||||||
|
"payload": {
|
||||||
|
"onTrue": "ON",
|
||||||
|
"onFalse": "OFF",
|
||||||
|
"brightnessFactor": "",
|
||||||
|
"hueFactor": "",
|
||||||
|
"saturationFactor": ""
|
||||||
|
},
|
||||||
|
"config": {}
|
||||||
|
},
|
||||||
"Gnd.Kitchen.WindowLight": {
|
"Gnd.Kitchen.WindowLight": {
|
||||||
"id": "Gnd.Kitchen.WindowLight",
|
"id": "Gnd.Kitchen.WindowLight",
|
||||||
"name": "Fensterbanklicht Küche",
|
"name": "Fensterbanklicht Küche",
|
||||||
|
@ -7,7 +7,7 @@ export class Forwarder extends AItem {
|
|||||||
private targetTopics: string[]
|
private targetTopics: string[]
|
||||||
private inTopic: 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)
|
super(floor, room, item, label)
|
||||||
this.inTopic = `${this.topicFirstPart}/${topicLastPart}`
|
this.inTopic = `${this.topicFirstPart}/${topicLastPart}`
|
||||||
this.subscribeTopics = [ this.inTopic ]
|
this.subscribeTopics = [ this.inTopic ]
|
||||||
|
@ -11,7 +11,7 @@ export class M433SwitchItem extends AItem {
|
|||||||
private state: string
|
private state: string
|
||||||
private actionTopic: string
|
private actionTopic: string
|
||||||
private stateFeedbackTopic: string
|
private stateFeedbackTopic: string
|
||||||
private stateTopic: string
|
public stateTopic: string
|
||||||
private type: string
|
private type: string
|
||||||
|
|
||||||
constructor(floor: string, room: string, item: string, label: string, onCode: string, offCode: string, type: string = 'bulb') {
|
constructor(floor: string, room: string, item: string, label: string, onCode: string, offCode: string, type: string = 'bulb') {
|
||||||
|
41
src/main.ts
41
src/main.ts
@ -98,7 +98,7 @@ hallwayStandLight.start()
|
|||||||
allLabeledItems.push(hallwayStandLight)
|
allLabeledItems.push(hallwayStandLight)
|
||||||
|
|
||||||
// Flur Schranklicht 66581 24 1 66580 24 1
|
// Flur Schranklicht 66581 24 1 66580 24 1
|
||||||
let hallwayWardrobeLight = new M433SwitchItem('Gnd', 'Hallway', 'StandLight', 'Schranklicht Flur', '66581 24 1', '66580 24 1')
|
let hallwayWardrobeLight = new M433SwitchItem('Gnd', 'Hallway', 'WardrobeLight', 'Schranklicht Flur', '66581 24 1', '66580 24 1')
|
||||||
hallwayWardrobeLight.start()
|
hallwayWardrobeLight.start()
|
||||||
allLabeledItems.push(hallwayWardrobeLight)
|
allLabeledItems.push(hallwayWardrobeLight)
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ allLabeledItems.push(kitchenWindowLight)
|
|||||||
|
|
||||||
// Küche Deckenlampe 82197 24 1 82196 24 1
|
// Küche Deckenlampe 82197 24 1 82196 24 1
|
||||||
let kitchenCeilingLight = new M433SwitchItem('Gnd', 'Kitchen', 'CeilingLight', 'Deckenlampe Küche', '82197 24 1', '82196 24 1')
|
let kitchenCeilingLight = new M433SwitchItem('Gnd', 'Kitchen', 'CeilingLight', 'Deckenlampe Küche', '82197 24 1', '82196 24 1')
|
||||||
kitchenWindowLight.start()
|
kitchenCeilingLight.start()
|
||||||
allLabeledItems.push(kitchenCeilingLight)
|
allLabeledItems.push(kitchenCeilingLight)
|
||||||
|
|
||||||
|
|
||||||
@ -132,6 +132,43 @@ bedRoomWindowLight.start()
|
|||||||
allLabeledItems.push(bedRoomWindowLight)
|
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, [
|
let testFourButton = new HomematicFourButtonThing('Gnd', 'Hallway', 'TestButton', 9, [
|
||||||
new HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/Testlight/dimmerIn'),
|
new HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/Testlight/dimmerIn'),
|
||||||
|
Reference in New Issue
Block a user