diff --git a/accessories/aircon.js b/accessories/aircon.js index 805f1be0..11c7576d 100644 --- a/accessories/aircon.js +++ b/accessories/aircon.js @@ -363,8 +363,17 @@ class AirConAccessory extends BroadlinkRMAccessory { log(`${name} onTemperature (${temperature})`); - if (temperature > config.maxTemperature) temperature = config.maxTemperature - if (temperature < config.minTemperature) temperature = config.minTemperature + if (temperature > config.maxTemperature) { + temperature = config.maxTemperature + + log(`\x1b[36m[INFO] Reported temperature (${temperature}) is too high, setting to \x1b[33mmaxTemperature\x1b[0m`) + } + + if (temperature < config.minTemperature) { + temperature = config.minTemperature + + log(`\x1b[36m[INFO] Reported temperature (${temperature}) is too low, setting to \x1b[33mminTemperature\x1b[0m`) + } 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})`)