From c77f5b9096b96203f44657d56e3b5484aa2d4e41 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Sun, 15 Apr 2018 17:10:39 +0200 Subject: [PATCH] fix issue with failing off when heatmain is off --- dist/MaxThermostat.js | 13 ++++++------- src/MaxThermostat.ts | 11 +++++------ 2 files changed, 11 insertions(+), 13 deletions(-) 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) {