diff --git a/dist/MaxThermostat.js b/dist/MaxThermostat.js index 9e3e211..a5dbf63 100644 --- a/dist/MaxThermostat.js +++ b/dist/MaxThermostat.js @@ -54,13 +54,12 @@ class MaxThermostat extends AHomegearItem_1.AHomegearItem { setTemperature = true; } else if (topic == this.commandTopic) { - if (this.heatingMainFlag) { - if (payload == 'ON') { - this.temperature = this.presetTemperature; - } - else if (payload == 'OFF') { - this.temperature = DISABLED_TEMPERATURE; - } + if ((payload == 'ON') && this.heatingMainFlag) { + this.temperature = this.presetTemperature; + setTemperature = true; + } + else if (payload == 'OFF') { + this.temperature = DISABLED_TEMPERATURE; setTemperature = true; } } diff --git a/src/MaxThermostat.ts b/src/MaxThermostat.ts index d378662..96ae426 100644 --- a/src/MaxThermostat.ts +++ b/src/MaxThermostat.ts @@ -81,12 +81,11 @@ export class MaxThermostat extends AHomegearItem implements HasInTopic { this.temperature = parseFloat(payload) setTemperature = true } else if (topic == this.commandTopic) { - if (this.heatingMainFlag) { - if (payload == 'ON') { - this.temperature = this.presetTemperature - } else if (payload == 'OFF') { - this.temperature = DISABLED_TEMPERATURE - } + if ((payload == 'ON') && this.heatingMainFlag) { + this.temperature = this.presetTemperature + setTemperature = true + } else if (payload == 'OFF') { + this.temperature = DISABLED_TEMPERATURE setTemperature = true } } else if (topic == MaxThermostat.heatingMainSwitchTopic) {