cr3ative / homebridge-apcaccess

what if apcaccess, but in homebridge??
MIT License
8 stars 4 forks source link

Unable to change log level #23

Closed ThisIsQasim closed 1 year ago

ThisIsQasim commented 1 year ago

Getting the following error if I set errorLogsOnly: true

[APC Smart-UPS] Polling UPS service failed: TypeError: this.log.update.warn is not a function
    at APCAccess.checkContact (/homebridge/node_modules/homebridge-apcaccess/index.js:180:21)
    at APCAccess.doPolledChecks (/homebridge/node_modules/homebridge-apcaccess/index.js:238:10)
    at /homebridge/node_modules/homebridge-apcaccess/index.js:99:14
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
cr3ative commented 1 year ago

Ah oops. Let me see if I can push an update.

cr3ative commented 1 year ago

Published 1.0.3 to clean up that log line specifically, but I feel a refactor of the logging stuff coming on if it continues to be a problem. Give it a go.

ThisIsQasim commented 1 year ago

Thanks for the quick response. There is a new error on temperature

[9/1/2023, 6:25:38 PM] [homebridge-apcaccess] This plugin threw an error from the characteristic 'Current Temperature': Unhandled error thrown inside read handler for characteristic: this.log.update.error is not a function. See https://homebridge.io/w/JtMGR for more info.
cr3ative commented 1 year ago

lol, lmao. Okay, well, I can look at that. In the mean time, your UPS is clearly not happy - try running apcaccess on the command line and seeing the status; that has to work first.

ThisIsQasim commented 1 year ago

apcaccess works fine. In fact everything else is working fine except for the temperature sensor.

ThisIsQasim commented 1 year ago

My bad. The error was indeed from before when there was an issue with apcaccess. All good now!

cr3ative commented 1 year ago

Gotcha, thanks - that’s useful. And hey, at least it works with logs on! I’ll revise the logging soon.