base class and m433switch

This commit is contained in:
Wolfgang Hottgenroth
2018-01-02 18:24:10 +01:00
parent ac24b58038
commit 1c06b0f3a3
4 changed files with 66 additions and 9 deletions

View File

@ -1,15 +1,15 @@
let logger = require('./log');
let mqtt = require('./mqttHandler');
let AItem = require('./AItem')
class HomematicDimmerItem {
constructor(itemId, actionTopic) {
this.itemId = itemId;
this.stateTopic = `dispatcher_ng/items/${this.itemId}/state`;
this.brightTopic = `dispatcher_ng/items/${this.itemId}/bright`;
this.stateFeedbackTopic = `dispatcher_ng/items/${this.itemId}/state/feedback`;
this.brightFeedbackTopic = `dispatcher_ng/items/${this.itemId}/bright/feedback`;
class HomematicDimmerItem extends AItem {
constructor(floor, room, item, actionTopic) {
super(floor, room, item);
this.stateTopic = `${this.topicFirstPart}/state`;
this.brightTopic = `${this.topicFirstPart}/bright`;
this.stateFeedbackTopic = `${this.topicFirstPart}/state/feedback`;
this.brightFeedbackTopic = `${this.topicFirstPart}/bright/feedback`;
this.actionTopic = actionTopic;
this.state = 'OFF';
this.oldState = undefined;