homebridge / homebridge-config-ui-x

The Homebridge UI. Monitor, configure and backup Homebridge from a browser.
https://homebridge.io
MIT License
2.63k stars 382 forks source link

Incorrect `accessory` field in the UI generated config #1448

Closed adyanth closed 1 year ago

adyanth commented 1 year ago

Describe The Bug

Homebridge API spec says that the 1st argument of registerAccessory is the pluginIdentifier.

Plugin settings for config.schema.json says that the pluginAlias is the pluginIdentifier.

Doing so in my plugin v1.0.1 gets me:

Screenshot 2023-01-15 at 6 34 23 PM Screenshot 2023-01-15 at 6 34 59 PM

But, once I restart home bridge, I see the below logs:

[15/01/2023, 18:35:37] Loading 1 accessories...
[15/01/2023, 18:35:37] No plugin was found for the accessory "homebridge-plugin-command" in your config.json. Please make sure the corresponding plugin is installed correctly.

If I change to "accessory": "Command Accessory", it works.

[15/01/2023, 18:38:05] Loading 1 accessories...
[15/01/2023, 18:38:05] [File Command] Initializing Command Accessory accessory...

But if I change the config.schema.json pluginAlias to that in my plugin v1.0.2, I see a difference in the config UI but still the same accessory in the config, and the same error logs as before:

Screenshot 2023-01-15 at 6 43 15 PM Screenshot 2023-01-15 at 6 43 45 PM

Logs

No response

Config

No response

Homebridge UI Version

v4.50.2

Homebridge Version

v1.6.0

Node.js Version

v18.12.1

Operating System

Raspberry Pi OS / Raspbian

Environment Info

Raspberry Pi Model

Raspberry Pi Zero WH

adyanth commented 1 year ago

Setting the initialization to api.registerAccessory("Command Accessory", CommandAccessoryPlugin) works well. The 3 argument version causes issues with detection.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

adyanth commented 1 year ago

/remove-label stale

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.