Kellerlicht

This commit is contained in:
2018-05-24 22:09:35 +02:00
parent 7e2fb7edea
commit ab08986ca2
4 changed files with 27 additions and 6 deletions

View File

@ -10,12 +10,13 @@ class HomematicSwitchItem extends AHomegearItem_1.AHomegearItem {
getStateFeedbackTopic() {
return this.stateFeedbackTopic;
}
constructor(floor, room, item, label, hmId, type = 'bulb') {
constructor(floor, room, item, label, hmId, partId = 1, type = 'bulb') {
super(floor, room, item, label, hmId);
this.partId = partId;
this.stateTopic = `${this.topicFirstPart}/state`;
this.stateFeedbackTopic = `${this.topicFirstPart}/state/feedback`;
this.deviceFeedbackTopic = `${this.deviceTopicPre}/1/STATE`;
this.actionTopic = `${this.actionTopicPre}/1/STATE`;
this.deviceFeedbackTopic = `${this.deviceTopicPre}/${this.partId}/STATE`;
this.actionTopic = `${this.actionTopicPre}/${this.partId}/STATE`;
this.subscribeTopics = [
this.stateTopic,
this.deviceFeedbackTopic

8
dist/main.js vendored
View File

@ -363,6 +363,14 @@ let workshopLight = new HomematicSwitchItem_1.HomematicSwitchItem('Base', 'Works
workshopLight.start();
allLabeledItems.push(workshopLight);
allRelevantLights.push(workshopLight);
let basementSmallLight = new HomematicSwitchItem_1.HomematicSwitchItem('Base', 'Hallway', 'SmallLight', 'Licht Keller einfach', 35, 1);
basementSmallLight.start();
allLabeledItems.push(basementSmallLight);
allRelevantLights.push(basementSmallLight);
let basementLargeLight = new HomematicSwitchItem_1.HomematicSwitchItem('Base', 'Hallway', 'LargeLight', 'Licht Keller hell', 35, 2);
basementLargeLight.start();
allLabeledItems.push(basementLargeLight);
allRelevantLights.push(basementLargeLight);
// ----------------------------------------------------------------------------------------------------------
let twoLedSignal1 = new TwoLedSignal_1.TwoLedSignal('Gnd', 'Hallway', 'TwoLedSignal1', 'Licht- und Fenster-Anzeiger', allRelevantLights, "OFF", "ON", allWindows, "CLOSED", "OPEN");
twoLedSignal1.start();

View File

@ -12,6 +12,7 @@ export class HomematicSwitchItem extends AHomegearItem implements HasStateAndFee
private stateFeedbackTopic: string
private stateTopic: string
private type: string
private partId: number
getStateTopic() : string {
return this.stateTopic
@ -21,12 +22,13 @@ export class HomematicSwitchItem extends AHomegearItem implements HasStateAndFee
return this.stateFeedbackTopic
}
constructor(floor: string, room: string, item: string, label: string, hmId: number, type: string = 'bulb') {
constructor(floor: string, room: string, item: string, label: string, hmId: number, partId: number = 1, type: string = 'bulb') {
super(floor, room, item, label, hmId)
this.partId = partId
this.stateTopic = `${this.topicFirstPart}/state`
this.stateFeedbackTopic = `${this.topicFirstPart}/state/feedback`
this.deviceFeedbackTopic = `${this.deviceTopicPre}/1/STATE`
this.actionTopic = `${this.actionTopicPre}/1/STATE`
this.deviceFeedbackTopic = `${this.deviceTopicPre}/${this.partId}/STATE`
this.actionTopic = `${this.actionTopicPre}/${this.partId}/STATE`
this.subscribeTopics = [
this.stateTopic,
this.deviceFeedbackTopic

View File

@ -454,6 +454,16 @@ workshopLight.start()
allLabeledItems.push(workshopLight)
allRelevantLights.push(workshopLight)
let basementSmallLight = new HomematicSwitchItem('Base', 'Hallway', 'SmallLight', 'Licht Keller einfach', 35, 1)
basementSmallLight.start()
allLabeledItems.push(basementSmallLight)
allRelevantLights.push(basementSmallLight)
let basementLargeLight = new HomematicSwitchItem('Base', 'Hallway', 'LargeLight', 'Licht Keller hell', 35, 2)
basementLargeLight.start()
allLabeledItems.push(basementLargeLight)
allRelevantLights.push(basementLargeLight)
// ----------------------------------------------------------------------------------------------------------
let twoLedSignal1 = new TwoLedSignal('Gnd', 'Hallway', 'TwoLedSignal1', 'Licht- und Fenster-Anzeiger',