introduce interfaces for state/feedback topics
This commit is contained in:
@ -2,8 +2,9 @@ import * as logger from './log'
|
||||
import { mqttHandler } from './MqttDispatcher'
|
||||
import { AHomematicItem } from './AHomematicItem'
|
||||
import { SwitchExport, ExportType } from './Export'
|
||||
import { HasStateAndFeedbackTopic } from './AItem';
|
||||
|
||||
export class HomematicSwitchItem extends AHomematicItem {
|
||||
export class HomematicSwitchItem extends AHomematicItem implements HasStateAndFeedbackTopic {
|
||||
private oldState: string|undefined
|
||||
private state: string
|
||||
private actionTopic: string
|
||||
@ -12,6 +13,14 @@ export class HomematicSwitchItem extends AHomematicItem {
|
||||
private stateTopic: string
|
||||
private type: string
|
||||
|
||||
getStateTopic() : string {
|
||||
return this.stateTopic
|
||||
}
|
||||
|
||||
getStateFeedbackTopic() : string {
|
||||
return this.stateFeedbackTopic
|
||||
}
|
||||
|
||||
constructor(floor: string, room: string, item: string, label: string, hmId: number, type: string = 'bulb') {
|
||||
super(floor, room, item, label, hmId)
|
||||
this.stateTopic = `${this.topicFirstPart}/state`
|
||||
|
Reference in New Issue
Block a user