Skip to content

Commit

Permalink
Show the plugin version in the logs for improved debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
lprhodes committed Mar 22, 2018
1 parent 3248e32 commit 5b9904c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions accessories/aircon.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,13 @@ class AirConAccessory extends BroadlinkRMAccessory {
if (temperature > config.maxTemperature) {
temperature = config.maxTemperature

log(`\x1b[36m[INFO] Reported temperature (${temperature}) is too high, setting to \x1b[33mmaxTemperature\x1b[0m`)
log(`\x1b[36m[INFO]\x1b[0m 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`)
log(`\x1b[36m[INFO]\x1b[0m 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})`)
Expand Down
6 changes: 5 additions & 1 deletion platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ const BroadlinkRMPlatform = class extends HomebridgePlatform {
showMessage () {
const { config } = this;

if (config && (config.hideWelcomeMessage || config.isUnitTest)) return;
if (config && (config.hideWelcomeMessage || config.isUnitTest)) {
console.log(`\x1b[36m[INFO]\x1b[0m Running Homebridge Broadlink RM Plugin version \x1b[32m${npmPackage.version}\x1b[0m`)

return
}

setTimeout(() => {
console.log('')
Expand Down

0 comments on commit 5b9904c

Please sign in to comment.