diff --git a/accessories/aircon.js b/accessories/aircon.js index 552bba12..4d5c6705 100644 --- a/accessories/aircon.js +++ b/accessories/aircon.js @@ -224,7 +224,7 @@ class AirConAccessory extends BroadlinkRMAccessory { // Thermostat async sendTemperature (temperature, previousTemperature) { const { HeatingCoolingStates, config, data, host, log, name, state, debug } = this; - const { preventResendHex, defaultCoolTemperature, heatTemperature, sendTemperatureOnlyWhenOff } = config; + const { preventResendHex, defaultCoolTemperature, heatTemperature, ignoreTemperatureWhenOff, sendTemperatureOnlyWhenOff } = config; log(`${name} Potential sendTemperature (${temperature})`); @@ -246,13 +246,16 @@ class AirConAccessory extends BroadlinkRMAccessory { } } + if (!state.currentHeatingCoolingState && ignoreTemperatureWhenOff) { + return; + } + state.firstTemperatureUpdate = false; // Send the temperature hex this.log(`${name} sendTemperature (${state.targetTemperature}`); await this.performSend(hexData.data); - if (!state.currentHeatingCoolingState && sendTemperatureOnlyWhenOff) { return; }