Comments (8)
Thanks for the changes! Have verified the plugin now, please in the future adhere to:
A GitHub release - with patch notes - should be created for every new version of your plugin.
So that each version you release has some changes from the previous version listed!
from verified.
✅ Pre-checks completed successfully.
from verified.
Couple of things:
The plugin must run on all supported LTS versions of Node.js, at the time of writing this is Node.js v16 and v18.
Please update your package version node engine to show support for node 16 (and ensure the plugin works with node 16, at least the latest version), something like this:
"node": "^16.20.1 || ^18.17.0"
The plugin must not throw unhandled exceptions, the plugin must catch and log its own errors.
Looks like you aren't catching any errors that node-fetch
might throw when requesting an invalid URL (for example the default config URL). I saved the default config, and it is repeatedly crashing my homebridge instance:
[29/07/2023, 15:19:20] [Leak Sensor] Child bridge process ended
[29/07/2023, 15:19:20] [Leak Sensor] Process Ended. Code: 1, Signal: null
[29/07/2023, 15:19:27] [Leak Sensor] Restarting Process...
[29/07/2023, 15:19:28] [Leak Sensor] Launched child bridge with PID 4636
[29/07/2023, 15:19:28] The plugin "homebridge-http-leak-sensor" requires a Homebridge version of ^1.6.0 which does not satisfy the current Homebridge version of 2.0.0-beta.1. You may need to update this plugin (or Homebridge) to a newer version. You may face unexpected issues or stability problems running this plugin.
[29/07/2023, 15:19:28] The plugin "homebridge-http-leak-sensor" requires Node.js version of ^18.17.0 which does not satisfy the current Node.js version of v20.5.0. You may need to upgrade your installation of Node.js - see https://homebridge.io/w/JTKEF
[29/07/2023, 15:19:28] Registering accessory 'homebridge-http-leak-sensor.HomebridgeHTTPLeakSensor'
[29/07/2023, 15:19:28] [Leak Sensor] Loaded homebridge-http-leak-sensor v1.0.1 child bridge successfully
[29/07/2023, 15:19:28] Loaded 0 cached accessories from cachedAccessories.0E5760A93851.
[29/07/2023, 15:19:28] Homebridge v2.0.0-beta.1 (HAP v1.0.0-beta.8) (Leak Sensor) is running on port 57457.
FetchError: invalid json response body at http://localhost/status reason: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
at /usr/local/lib/node_modules/homebridge-http-leak-sensor/node_modules/node-fetch/lib/index.js:273:32
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at LeakSensorAccessory.handleLeakSensorSetState (/usr/local/lib/node_modules/homebridge-http-leak-sensor/src/index.ts:59:18)
[29/07/2023, 15:20:28] [Leak Sensor] Child bridge process ended
[29/07/2023, 15:20:28] [Leak Sensor] Process Ended. Code: 1, Signal: null
[29/07/2023, 15:20:35] [Leak Sensor] Restarting Process...
[29/07/2023, 15:20:36] [Leak Sensor] Launched child bridge with PID 4652
Maybe putting all of this in a try/catch
and then in the catch use this.log.warn
to output the error to the homebridge log.
This would be sufficient for verification, as the plugin would no longer be crashing homebridge.
What you could do (appreciate this is a bit more involved) is try to detect whether the http response is due to:
- a misconfigured url, or one that does not exist - and in this case cancel the interval to avoid repeated useless http calls every 60 seconds
- a working device which is (e.g.) temporarily offline and in this case continue the interval.
Just some ideas!
from verified.
I appreciate the feedback! I'll work on incorporating the changes you suggested. Thanks!
from verified.
Hi @bwp91
I'm ready for your review. I published a new version v1.0.2
implementing the changes you suggested. Here are links to the published releases. git
npm
Changes
I also addressed your more involved suggestion:
I created a user-configurable property called failedRequestsLimit
. The plugin will continue sending requests to the configured url until it hits this limit then it stop making requests. A value of 0
allows unlimited failed requests. I think this is a good middle-ground because it prevents the plugin from continuously making bad requests forever but also allows a grace period for interrupted devices to get back online.
If you have any other suggestions please let me know!
from verified.
/check
from verified.
✅ Pre-checks completed successfully.
from verified.
Congratulations! Your plugin has been verified.
You can now add the Verified by Homebridge badge to your plugin's README:
[![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
Your plugin is now also eligible to display a ❤️ Donate button on its tile in the Homebridge UI. See https://github.com/oznu/homebridge-config-ui-x/wiki/Developers:-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.
Thank you for your contribution to the Homebridge Community.
https://homebridge.io
from verified.
Related Issues (20)
- Verification Request: @xenuiswatching/homebridge-hubspace HOT 4
- Verification Request: homebridge-iRobot-v2 HOT 18
- Verification Request: homebridge-blaq HOT 12
- Verification Request: homebridge-philipstv-saphitvos HOT 7
- Verification Request: @pietrolubini/homebridge-ecoflow HOT 14
- Verification Request: homebridge-samsung-windfree-ac HOT 6
- Verification Request: homebridge-mhi-wfrac HOT 6
- Verification Request: homebridge-cgd-garage-door HOT 11
- Verification Request: homebridge-kasa-python HOT 12
- Verification Request: homebridge-wemo HOT 5
- Verification Request: homebridge-hejhome HOT 16
- Verification Request: homebridge-tempstick HOT 5
- Verification Request: @vandubois/homebridge-virtual-switch HOT 10
- Verification Request: homebridge-tovala HOT 12
- Verification Request: homebridge-agile-octopus-rates HOT 12
- Verification Request: homebridge-http-sensors-switches HOT 8
- Verification Request: homebridge-air HOT 6
- Verification Request: homebridge-sleepme HOT 3
- Verification Request: homebridge-ecowitt-weather-sensors HOT 8
- Verification Request: homebridge-simple-router-status HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from verified.