Skip to content

Commit

Permalink
Another attempt at fixing sendTemperatureOnlyWhenOff
Browse files Browse the repository at this point in the history
  • Loading branch information
lprhodes committed Mar 20, 2018
1 parent d789c71 commit ac8aefa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions accessories/aircon.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,20 +246,18 @@ class AirConAccessory extends BroadlinkRMAccessory {
}
}

if (state.currentHeatingCoolingState !== Characteristic.TargetHeatingCoolingState.OFF && sendTemperatureOnlyWhenOff) {
return;
}

state.firstTemperatureUpdate = false;

// Send the temperature hex
this.log(`${name} sendTemperature (${state.targetTemperature}`);
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"');
Expand Down

0 comments on commit ac8aefa

Please sign in to comment.