verified
verified copied to clipboard
homebridge-hsd
Link To GitHub Repo
https://github.com/En3rGy/homebridge-hsd
Link To NPM Package
https://www.npmjs.com/package/homebridge-hsd
Plugin Icon (Optional)
No response
The following pre-checks failed:
:x: The config.schema.json does not contain valid JSON.
Comment /check
to run checks again.
/check
:white_check_mark: Pre-checks completed successfully.
Hi @En3rGy quick question, does "jasmine": "^5.1.0",
need to be in your dependencies or can this go to dev dependencies?
Hi @bwp91 , thanks for the point. Checked the dependencies and cleaned them up. Git and npm are up to date with the new v1.1.3.
-
General
- [x] The plugin must be of type dynamic platform.
- [x] The plugin must not offer the same nor less functionality than that of any existing verified plugin.
-
Repo
- [x] The plugin must be published to NPM and the source code available on a GitHub repository, with issues enabled.
- [x] A GitHub release should be created for every new version of your plugin, with release notes.
-
Environment
- [x] The plugin must run on all supported LTS versions of Node.js, at the time of writing this is Node v18 and v20.
- [x] The plugin must successfully install and not start unless it is configured.
- [x] The plugin must not execute post-install scripts that modify the users' system in any way.
- [x] The plugin must not require the user to run Homebridge in a TTY or with non-standard startup parameters, even for initial configuration.
-
Codebase
- [x] The plugin must implement the Homebridge Plugin Settings GUI.
- [x] The plugin must not contain any analytics or calls that enable you to track the user.
- [x] If the plugin needs to write files to disk (cache, keys, etc.), it must store them inside the Homebridge storage directory.
- [x] The plugin must not throw unhandled exceptions, the plugin must catch and log its own errors.
Comment /check
to run checks again.
Hi @En3rGy I installed the plugin, then opened the plugin UI and saved an initial config without changing any values.
After restarting Homebridge, it went into a crash loop with these errors:
[16/03/2024, 18:32:57] [hsd] Initializing hsd platform...
[16/03/2024, 18:32:57] Error: hsdPlatform.ts | HsdPlatform | Invalid configuration
at new HsdPlatform (/usr/local/lib/node_modules/homebridge-hsd/src/hsdPlatform.ts:31:13)
at /usr/local/lib/node_modules/homebridge/src/server.ts:474:40
at Array.forEach (<anonymous>)
at Server.loadPlatforms (/usr/local/lib/node_modules/homebridge/src/server.ts:401:27)
at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:176:29)
[16/03/2024, 18:32:57] Got SIGTERM, shutting down Homebridge...
[16/03/2024, 18:32:57] AssertionError [ERR_ASSERTION]: Cannot generate setupURI on an accessory that isn't published yet!
at Bridge.Accessory.setupURI (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:994:11)
at Server.setServerStatus (/usr/local/lib/node_modules/homebridge/src/server.ts:155:45)
at Server.teardown (/usr/local/lib/node_modules/homebridge/src/server.ts:199:10)
at signalHandler (/usr/local/lib/node_modules/homebridge/src/cli.ts:93:12)
at process.emit (node:events:518:28)
at process.emit (/usr/local/lib/node_modules/homebridge/node_modules/source-map-support/source-map-support.js:516:21)
[16/03/2024, 18:33:02] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
The plugin should not terminate the process as this ended up continually restarting my homebridge and all the plugins I have.
Errors that happen should be caught properly and logged, but not crash.
@bwp91 could you please post your test config so that I can update my test cases?
Yes is this:
{
"accessories": [
{
"services": [
{
"serviceType": "Lightbulb",
"characteristics": [
{
"characteristicName": "On"
}
]
}
]
}
],
"hsPort": 443,
"platform": "hsd"
}
is the config that is saved when opening the config screen for the first time and just clicking save straight away.
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.
The fix is online, see https://github.com/En3rGy/homebridge-hsd/releases/tag/v1.1.7 resp. https://www.npmjs.com/package/homebridge-hsd/v/1.1.7 I'm still struggeling to simulate a homebridge API instance for unit testing. Any tips for this one?
@En3rGy with regards to unit testing, perhaps the homebridge/ui test files could be of use?
-
.spec.ts
files here: https://github.com/homebridge/homebridge/blob/latest/src/api.spec.ts - testing folder here: https://github.com/homebridge/homebridge-config-ui-x/tree/latest/test
Also I just reinstalled the plugin, saved the default config of:
{
"accessories": [
{
"services": [
{
"serviceType": "Lightbulb",
"characteristics": [
{
"characteristicName": "On"
}
]
}
]
}
],
"hsPort": 443,
"platform": "hsd",
"_bridge": {
"username": "removed"
}
}
and now getting this crash loop:
[04/05/2024, 13:18:10] Registering platform 'homebridge-hsd.hsd'
[04/05/2024, 13:18:10] [homebridge-hsd] Loaded homebridge-hsd v1.1.7 child bridge successfully
[04/05/2024, 13:18:10] [homebridge-hsd] hsdPlatform.ts | HsdPlatform | Invalid configuration
[04/05/2024, 13:18:10] [homebridge-hsd] hs.ts | HomeServerConnector | connect > Current connection state is 0
/usr/local/lib/node_modules/homebridge-hsd/node_modules/ws/lib/websocket.js:691
throw new SyntaxError(`Invalid URL: ${address}`);
^
SyntaxError: Invalid URL: wss://:0/endpoints/ws?authorization=Og%3D%3D
at initAsClient (/usr/local/lib/node_modules/homebridge-hsd/node_modules/ws/lib/websocket.js:691:13)
at new WebSocket (/usr/local/lib/node_modules/homebridge-hsd/node_modules/ws/lib/websocket.js:85:7)
at HomeServerConnector.connect (/usr/local/lib/node_modules/homebridge-hsd/src/hs.ts:94:16)
at HsdPlatform.connect (/usr/local/lib/node_modules/homebridge-hsd/src/hsdPlatform.ts:24:10)
at HomebridgeAPI.<anonymous> (/usr/local/lib/node_modules/homebridge-hsd/src/hsdPlatform.ts:45:44)
at HomebridgeAPI.emit (node:events:518:28)
at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:275:10)
at ChildBridgeFork.startBridge (/usr/local/lib/node_modules/homebridge/src/childBridgeFork.ts:194:14)
[04/05/2024, 13:18:11] [homebridge-hsd] Child bridge process ended
[04/05/2024, 13:18:11] [homebridge-hsd] Process Ended. Code: 1, Signal: null
New version v1.1.9 is online: https://www.npmjs.com/package/homebridge-hsd
Congratulations! Your plugin has been verified!
You can now add one of the Verified by Homebridge badges to your plugin's README:
[](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
[](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
Your plugin is now also eligible to display a :heart: Donate button on its tile in the Homebridge UI. See https://github.com/homebridge/homebridge/wiki/Donation-Links for instructions.
If for any reason in the future you can no longer maintain your plugin, please consider transferring it to our unmaintained plugins repo. We can take ownership until another willing developer comes along.
Don't forget to join the official Homebridge Discord server, where plugin developers can get tips and advice from other developers and the Homebridge project team in the #plugin-development channel!
As a verified plugin, you can request a channel in the Discord server to discuss your plugin with users and other developers. Just ask in the #plugin-development channel.
Thank you for your contribution to the Homebridge community.
- The Homebridge Team