Closed thieren closed 2 years ago
It seems to be working when I build the plugin locally:
The UI may aggressively cache the customUiPath
- please make sure you've tried to do a full restart of Homebridge UI (Drop down menu top right -> Homebridge Settings -> Force Service Restart).
I did initially get this error, but it's unrelated to the problem you were facing:
[09/07/2022, 18:28:54] [Homebridge UI] [homebridge-eufy-security] node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '../package.json'
Require stack:
- /Users/xxxxx/src/homebridge/Homebridge-eufy-plugin/dist/homebridge-ui/server.js
After fixing that it loaded fine.
Thx for your fast feedback.
The UI may aggressively cache the customUiPath - please make sure you've tried to do a full restart of Homebridge UI (Drop down menu top right -> Homebridge Settings -> Force Service Restart).
Force restart did help. But didn't realise that there is a difference to normal restart before. This way I don't think it's suitable for our plugin since most users would face this issue. (we used default path before, but the new path would suit our new workspace structure better).
Could the path caching be reset on normal restart?
The cache is per version of the plugin, and since you can't publish the same version twice, it will never be an issue in the real world.
My last comment may not be correct sorry.
Expecting users to also update the UI might be an issue, you can probably get away with creating a symlink from ./homebridge-ui
to ./dist/homebridge-ui
and publishing it as part of the package:
ln -s dist/homebridge-ui homebridge-ui
But wouldn't users running homebridge on windows have problems with symlinks?
Probably, but you're looking at less than 2% of total Homebridge users who run on Windows natively.
Fixed in 4.49.1-test.1
Wow. Thx for the fast fix!
I forgot to mention this yesterday. You should probably move the Angular and other UI dependencies to devDependencies
, as once the bundle is created you don't need these at run time, and making your users install all these packages alongside your plugin will just slow things down.
https://github.com/thieren/Homebridge-eufy-plugin/blob/customUiPath/package.json#L37
I forgot to mention this yesterday. You should probably move the Angular and other UI dependencies to
devDependencies
, as once the bundle is created you don't need these at run time, and making your users install all these packages alongside your plugin will just slow things down.https://github.com/thieren/Homebridge-eufy-plugin/blob/customUiPath/package.json#L37
Yeah you're likely right. I just used the default dependencies generated by ng new
when creating a new angular app.
But will look into it and move the dependencies not needed. Thx!
Describe The Bug
Hi!
I'm working with the homebridge-eufy-security team and have recently redesigned the custom ui screen which utilises plugin-ui-utils. As mentioned here it should be possible to set a custom path to the ui through
config.schema.json
but for me this setting is ignored. It always falls back to the default./homebridge-ui/public/index.html
I looked briefly at the source and found that this setting is read in this repo rather thenplugin-ui-utils
, so I've opened an issue here.An example branch can be found here
Let me know if the issue lies somewhere else.
Logs
Config
Homebridge UI Version
4.49.0
Homebridge Version
1.5.0
Node.js Version
16.13.0
Operating System
Ubuntu / Debian (or a variant)
Environment Info
Raspberry Pi Model
No response