introduce interfaces for state/feedback topics
This commit is contained in:
@ -1,19 +1,27 @@
|
||||
import * as logger from './log'
|
||||
import { mqttHandler } from './MqttDispatcher'
|
||||
import { AItem } from './AItem'
|
||||
import { AItem, HasStateAndFeedbackTopic } from './AItem'
|
||||
import { SwitchExport, ExportType } from './Export'
|
||||
|
||||
|
||||
export class M433SwitchItem extends AItem {
|
||||
export class M433SwitchItem extends AItem implements HasStateAndFeedbackTopic {
|
||||
private offCode: string
|
||||
private onCode: string
|
||||
private oldState: string|undefined
|
||||
private state: string
|
||||
private actionTopic: string
|
||||
private stateFeedbackTopic: string
|
||||
public stateTopic: string
|
||||
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, onCode: string, offCode: string, type: string = 'bulb') {
|
||||
super(floor, room, item, label)
|
||||
this.stateTopic = `${this.topicFirstPart}/state`
|
||||
|
Reference in New Issue
Block a user