Skip to content

Commit

Permalink
lower default logging noise levels now that #90 is under control
Browse files Browse the repository at this point in the history
Signed-off-by: António Meireles <antonio.meireles@reformi.st>
  • Loading branch information
AntonioMeireles committed Jan 22, 2022
1 parent bec3768 commit 53ec1c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 5 additions & 7 deletions src/accessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,11 @@ class VieramaticPlatformAccessory {
async setPowerStatus(nextState: CharacteristicValue): Promise<void> {
const message = nextState === this.Characteristic.Active.ACTIVE ? 'ON' : 'into STANDBY'
const currentState = await VieraTV.isTurnedOn(this.device.address)
this.log.info('(setPowerStatus) this.device:', prettyPrint(this.device))
this.log.info('(setPowerStatus) this.userConfig:', prettyPrint(this.userConfig))
this.log.info('(setPowerStatus)', nextState, currentState)
this.log.debug('(setPowerStatus)', nextState, currentState)
if ((nextState === this.Characteristic.Active.ACTIVE) === currentState)
this.log.info('TV is already %s: Ignoring!', message)
this.log.debug('TV is already %s: Ignoring!', message)
else if (nextState === this.Characteristic.Active.ACTIVE && this.userConfig.mac) {
this.log.info('sending WOL packets to awake TV')
this.log.debug('sending WOL packets to awake TV')
// takes 1 sec (10 magic qpkts sent with 100ms interval)
try {
await wakeOnLan(this.userConfig.mac, { packets: 10 })
Expand All @@ -435,14 +433,14 @@ class VieramaticPlatformAccessory {
// wait another sec for older sets with slowish CPUs
await sleep(1000)
await this.updateTVstatus(nextState)
this.log.info('Turned TV', message)
this.log.debug('Turned TV', message)
} else {
const cmd = await this.device.sendKey('POWER')
if (Abnormal(cmd))
this.log.error('(setPowerStatus)/-> %s - unable to power cycle TV - unpowered ?', message)
else {
await this.updateTVstatus(nextState)
this.log.info('Turned TV', message)
this.log.debug('Turned TV', message)
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ class VieramaticPlatform implements DynamicPlatformPlugin {

if (device.friendlyName !== undefined) tv.specs.friendlyName = device.friendlyName
tv.specs.friendlyName = tv.specs.friendlyName.trim()
tv.log.info('userConfig', prettyPrint(device))
tv.log.info('accessory.context.device', prettyPrint(tv))

try {
const accessory = new this.api.platformAccessory(
tv.specs.friendlyName,
Expand Down

0 comments on commit 53ec1c3

Please sign in to comment.