Closed cyberpower678 closed 3 months ago
This issue is related to HOOBS caching the older configurations and cannot be fixed. Please re-flash your system using Homebridge.
This is a HOOBs hub, not a custom pi. I don't think it can be reflashed, and I've got 7 other bridges on there as well. Reflashing is not an option here. I think the simpler solution is to code in a catch where options is missing and just replace it with an empty list when initializing. Should be a 1-2 line fix?
I'm also adding the fact that the older configuration is not asserting itself here. It's literally deleting an empty list from the JSON entirely. Everything else in the new configuration remains untouched. This does not seem like a caching issue. This tells me HOOBs is just cleaning up empty options and removing them. So the solution here would be to catch if "options" is missing and just default it to [].
Will try to find an alternative pattern in the meantime.
I don't fully understand your design pattern as that seems like a great simple and non-hacky way to fix it, but I look forward to see the solution getting implemented. :-)
Because there is a difference between []
vs null
vs undefined
in JS. I simply choose a path that would be more visual, if it's empty, it's empty.
I have reviewed your pull request, and made some more additional changes. The release v3.3.0 has been released and partially credited to you. Thanks!
Due to inactivity, this issue will be locked and marked as resolved. If you have any further questions or inquiries, please feel free to open a new issue.
Pre-check confirmation
README.md
file, and this is NOT a duplicate bug reportYour email address
cybernet678@yahoo.com
Tell me exactly what happened
I upgraded from v2 to v3, and followed the docs to reconfigure the plugin directly via the JSON editor. All values are accepted but the logs keep complaining that it can't start due to missing options. When I add an empty list of options, it gets deleted by the plugin immediately. I added a "dummy" option to the list to keep it there, and that seems to keep the value there and the plugin happy, at least up until v3.0.6. Anything higher will complain about a bad option being present, so now it's either erased when it's empty, or it complains about a "dummy" option being present.
Plugin version
3.0.0+
Homebridge version
1.7.0
Node.js® version
16.20.2
Output of the "test-api" command
Captured logs relevant to this report
Post-check confirmation
Legal Agreements