From ac8aefac7f923c720ac6c36e24b189087b9dc22a Mon Sep 17 00:00:00 2001 From: Luke Rhodes Date: Tue, 20 Mar 2018 17:18:50 +1100 Subject: [PATCH] Another attempt at fixing `sendTemperatureOnlyWhenOff` --- accessories/aircon.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/accessories/aircon.js b/accessories/aircon.js index 30c1754d..9e656da1 100644 --- a/accessories/aircon.js +++ b/accessories/aircon.js @@ -246,10 +246,6 @@ class AirConAccessory extends BroadlinkRMAccessory { } } - if (state.currentHeatingCoolingState !== Characteristic.TargetHeatingCoolingState.OFF && sendTemperatureOnlyWhenOff) { - return; - } - state.firstTemperatureUpdate = false; // Send the temperature hex @@ -257,9 +253,11 @@ class AirConAccessory extends BroadlinkRMAccessory { await this.performSend(hexData.data); - // Update the heating/cooling mode based on the temperature. - + if (!state.currentHeatingCoolingState && sendTemperatureOnlyWhenOff) { + return; + } + // Update the heating/cooling mode based on the temperature. let mode = hexData['pseudo-mode']; if (mode) assert.oneOf(mode, [ 'heat', 'cool', 'auto' ], '\x1b[31m[CONFIG ERROR] \x1b[33mpseudo-mode\x1b[0m should be one of "heat", "cool" or "auto"');