rework thermostat
This commit is contained in:
@ -2,8 +2,9 @@ import * as logger from './log'
|
||||
import { mqttHandler } from './MqttDispatcher'
|
||||
import { AHomegearItem } from './AHomegearItem'
|
||||
import { ContactExport, ExportType } from './Export'
|
||||
import { Disabler } from './Disabler'
|
||||
|
||||
export class MaxWindowContact extends AHomegearItem {
|
||||
export class MaxWindowContact extends AHomegearItem implements Disabler {
|
||||
private deviceFeedbackTopic: string
|
||||
private stateFeedbackTopic: string
|
||||
private stateTopic: string
|
||||
@ -13,6 +14,18 @@ export class MaxWindowContact extends AHomegearItem {
|
||||
return this.stateFeedbackTopic
|
||||
}
|
||||
|
||||
transform(payload: string) : string {
|
||||
let res: string
|
||||
if (payload == 'OPEN') {
|
||||
res = 'DISABLE'
|
||||
} else if (payload == 'CLOSED') {
|
||||
res = 'ENABLE'
|
||||
} else {
|
||||
res = 'UNKNOWN'
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
constructor(floor: string, room: string, item: string, label: string, hmId: number) {
|
||||
super(floor, room, item, label, hmId)
|
||||
this.stateTopic = `${this.topicFirstPart}/state`
|
||||
|
Reference in New Issue
Block a user