Skip to content

Commit

Permalink
If the temperature is reported as more or less than min/maxTemperatur…
Browse files Browse the repository at this point in the history
…e then set it to that value
  • Loading branch information
lprhodes committed Mar 22, 2018
1 parent 6b4d48c commit 7fe78f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions accessories/aircon.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ class AirConAccessory extends BroadlinkRMAccessory {
state.currentTemperature = temperature;

log(`${name} onTemperature (${temperature})`);

if (temperature > config.maxTemperature) temperature = config.maxTemperature
if (temperature < config.minTemperature) temperature = config.minTemperature

assert.isBelow(temperature, config.maxTemperature + 1, `\x1b[31m[CONFIG ERROR] \x1b[33mmaxTemperature\x1b[0m (${config.maxTemperature}) must be more than the reported temperature (${temperature})`)
assert.isAbove(temperature, config.minTemperature - 1, `\x1b[31m[CONFIG ERROR] \x1b[33mminTemperature\x1b[0m (${config.maxTemperature}) must be less than the reported temperature (${temperature})`)
Expand Down

0 comments on commit 7fe78f3

Please sign in to comment.