normen / homebridge-bravia

Homebridge plugin for Sony Bravia TVs (AndroidTV based ones and possibly others)
139 stars 26 forks source link

Can't remove BraviaPlatform config without error #90

Closed LeJeko closed 4 years ago

LeJeko commented 4 years ago

Thank you for your plugin but with latest updates, my accessory suddenly not showing channels and did not response as usual. No worry I tried to recreate it.

But if I remove the BraviaPlatform config, homebridge loop on this error:

Load homebridge-bravia.BraviaPlatform. [12/05/2020, 23:18:28] TypeError: Cannot read property 'debug' of null. at new BraviaPlatform (/usr/local/lib/node_modules/homebridge-bravia/index.js:14:18). ....

After reading the code, I've found that I need to remove only the "tvs" config and the accessory is correctly removed:

[BraviaPlatform] Removing TV Sony OLED from HomeKit

Anyway, now if I remove completely BraviaPlatform the error stay because of no config is found....

I have recreated my accessory and it works well again but I think it would be great to handle the case when removing the BraviaPlatform config.

normen commented 4 years ago

I think you might be using an old version of homebridge? Afaik the newer versions don't call the platform constructor without a config anymore (which is whats happening here).

normen commented 4 years ago

Either way, this shouldn't happen anymore in 2.1.11

LeJeko commented 4 years ago

You're right! Great new behavior of homebridge 1.x, I had to manage the case for my "old" plugins... Thanks for the fix for older versions, even orphaned accessory stay in Home app, at least it don't crash!