Skip to content

Commit

Permalink
Added ignoreTemperatureWhenOff option to the air-conditioner.
Browse files Browse the repository at this point in the history
  • Loading branch information
lprhodes committed Mar 22, 2018
1 parent bf22add commit cf620b5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions accessories/aircon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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})`);

Expand All @@ -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;
}
Expand Down

0 comments on commit cf620b5

Please sign in to comment.