AlexanderBabel / homebridge-broadlink-rm

[This fork supports TV accessories] Broadlink RM Mini and Pro plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
46 stars 11 forks source link

Log is not defined #62

Closed stefantitu closed 4 years ago

stefantitu commented 4 years ago

I added today a few buttons in broadlink plugin and after that, even after I deleted the buttons, i get this error:

[12/18/2019, 5:18:39 PM] ReferenceError: log is not defined at Object.keys.forEach (/usr/local/lib/node_modules/homebridge-broadlink-rm-tv/node_modules/homebridge-platform-helper/accessory.js:72:9) at Array.forEach (:null:null) at SwitchAccessory.checkConfig (/usr/local/lib/node_modules/homebridge-broadlink-rm-tv/node_modules/homebridge-platform-helper/accessory.js:54:25) at Object.keys.forEach (/usr/local/lib/node_modules/homebridge-broadlink-rm-tv/node_modules/homebridge-platform-helper/accessory.js:66:14) at Array.forEach (:null:null) at SwitchAccessory.checkConfig (/usr/local/lib/node_modules/homebridge-broadlink-rm-tv/node_modules/homebridge-platform-helper/accessory.js:54:25) at new HomebridgeAccessory (/usr/local/lib/node_modules/homebridge-broadlink-rm-tv/node_modules/homebridge-platform-helper/accessory.js:35:10) at new BroadlinkRMAccessory (/usr/local/lib/node_modules/homebridge-broadlink-rm-tv/accessories/accessory.js:16:5) at new SwitchAccessory (/usr/local/lib/node_modules/homebridge-broadlink-rm-tv/accessories/switch.js:10:5) at config.accessories.forEach (/usr/local/lib/node_modules/homebridge-broadlink-rm-tv/platform.js:68:32) at Array.forEach (:null:null) at BroadlinkRMPlatform.addAccessories (/usr/local/lib/node_modules/homebridge-broadlink-rm-tv/platform.js:63:24) at BroadlinkRMPlatform.accessories (/usr/local/lib/node_modules/homebridge-broadlink-rm-tv/node_modules/homebridge-platform-helper/platform.js:28:10) at Server._loadPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:403:20) at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:341:16) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:90:36) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)

[12/18/2019, 5:18:40 PM] Got SIGTERM, shutting down Homebridge...

kiwi-cam commented 4 years ago

I can't do much to help here - this error is in this module (which is a dependency): https://github.com/lprhodes/homebridge-platform-helper. I've raised an issue there, and tagged you :-)

The error being thrown (which is erroring trying to write to the log) is \x1b[31m[CONFIG ERROR]\x1b[0m ${name}Numeric values should look like this: \x1b[32m"${key}": ${value}\x1b[0m not this \x1b[31m"${key}": "${value}"\x1b[0m. Basically it's checking your config and finding a number in quotes, making it a string; numbers in JSON shouldn't have quotes.

EDIT- I should add that @lprhodes hasn't been actively developing for some time so don't get your hopes up for a fix.

stefantitu commented 4 years ago

Thank you. I have found the mistake. I created a switch and the name of it was "1". After I tried everything on earth, nothing was fixing this issue. So I changed the name of the switch and realised that was the problem....stupid

kiwi-cam commented 4 years ago

No problem. It's still a valid bug in the other module and worth raising. I've had the issue before too when using a short hexcode that was only decimal digits... it's correct for it to be a string but fails this validation.

Glad everything is working.