adjust main

This commit is contained in:
2018-04-06 23:09:51 +02:00
parent 37acc620d5
commit c503e31ee5
4 changed files with 79 additions and 62 deletions

View File

@ -60,15 +60,19 @@ export class MaxThermostat extends AHomegearItem implements HasInTopic {
})
}
setPresetTemperature(presetTemperature: number) {
this.processMessage(this.presetTemperatureTopic, `${presetTemperature}`)
}
processMessage(topic: string, payload: string) : void {
let setTemperature : boolean = false
if (topic == this.temperatureTopic) {
this.temperature = parseFloat(payload)
setTemperature = true
} else if (topic == this.commandTopic) {
if (payload == 'START') {
if (payload == 'ON') {
this.temperature = this.presetTemperature
} else {
} else if (payload == 'OFF') {
this.temperature = DISABLED_TEMPERATURE
}
setTemperature = true