Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Homebridge v2 #198

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jsiegenthaler
Copy link
Contributor

0.1.19-beta.1

From jsiegenthaler:
Updated package.json to show compatibility with Homebridge v2
tested on homebdrige v2 with a motion sensor, all OK
Updated dependencies:
"http-auth": "^4.2.0",
"node-persist": "^2.1.0",
"request": "^2.88.2",
"selfsigned": "^2.4.1"
NOTE: a newer version of node-persist exists but all storage commands are async , requiring more code changes

@jsiegenthaler jsiegenthaler mentioned this pull request Sep 23, 2024
Fixed typos
@jsiegenthaler
Copy link
Contributor Author

I'd like someone to review please

@benzman81
Copy link
Owner

This is awesome. No code changea at all needed?

@jsiegenthaler
Copy link
Contributor Author

Nope. But note I only tested the motion sensor. Strictly speaking, we should test every sensor type as I see you have a chunk of code per sensor. If you had some non-conformal code, it would through an error in Homebridge v2. But of course, if the code is done well, and you stick to the defined characteristic values, then no error will occur.

@benzman81
Copy link
Owner

Ok, I will check how I can upgrade my docker homebridge to v2. This way some more accessories will be tested.

@jsiegenthaler jsiegenthaler changed the title Compatibility with Hoembridge v2 Compatibility with Homebridge v2 Sep 24, 2024
@jsiegenthaler
Copy link
Contributor Author

jsiegenthaler commented Sep 24, 2024

I've created a full config with all supported accessories. Found this small issue, I'll fix it:

[24.09.2024, 06:30:57] Initializing platform accessory 'Fanv2-1'...
HAP-NodeJS WARNING: The accessory 'Fanv2-1' has an invalid 'Name' characteristic ('Fanv2-1'). Please use only alphanumeric, space, and apostrophe characters. Ensure it starts and ends with an alphabetic or numeric character, and avoid emojis. This may prevent the accessory from being added in the Home App or cause unresponsiveness.

Also fixed some names in the example config to be consistent with other examples

@jsiegenthaler
Copy link
Contributor Author

Testing of each and ever sensor still needs to be done

@benzman81
Copy link
Owner

Awesome. As soon as I can update my homebridge to v2 I will test it and merge it.

@jsiegenthaler
Copy link
Contributor Author

jsiegenthaler commented Sep 25, 2024

Noted one issue last night:
[24.09.2024, 22:57:33] [homebridge-http-webhooks] This plugin generated a warning from the characteristic 'Current Ambient Light Level': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.
This will need fixing in the code

Caused by
[25.09.2024, 07:05:41] [homebridge-http-webhooks] Error: at CurrentAmbientLightLevel.characteristicWarning (C:\Users\jochen\AppData\Roaming\npm\node_modules\homebridge\node_modules\hap-nodejs\src\lib\Characteristic.ts:2785:105) at CurrentAmbientLightLevel.validateUserInput (C:\Users\jochen\AppData\Roaming\npm\node_modules\homebridge\node_modules\hap-nodejs\src\lib\Characteristic.ts:2673:14) at C:\Users\jochen\AppData\Roaming\npm\node_modules\homebridge\node_modules\hap-nodejs\src\lib\Characteristic.ts:2284:24 at C:\Users\jochen\AppData\Roaming\npm\node_modules\homebridge\node_modules\hap-nodejs\src\lib\util\once.ts:15:14 at HttpWebHookSensorAccessory.getState (C:\Users\jochen\Documents\GitHub\homebridge-http-webhooks\src\homekit\accessories\HttpWebHookSensorAccessory.js:155:5) at CurrentAmbientLightLevel.emit (node:events:519:28) at C:\Users\jochen\AppData\Roaming\npm\node_modules\homebridge\node_modules\hap-nodejs\src\lib\Characteristic.ts:2267:14 at new Promise (<anonymous>) at CurrentAmbientLightLevel.handleGetRequest (C:\Users\jochen\AppData\Roaming\npm\node_modules\homebridge\node_modules\hap-nodejs\src\lib\Characteristic.ts:2265:12) at CurrentAmbientLightLevel.toHAP (C:\Users\jochen\AppData\Roaming\npm\node_modules\homebridge\node_modules\hap-nodejs\src\lib\Characteristic.ts:2850:22)

I'll look at it tonight

@jsiegenthaler
Copy link
Contributor Author

jsiegenthaler commented Sep 25, 2024

Saw a logging error and fixed it, and fixed some capitalisation errors in the logging in HttpWebHookThermostatAccessory.js, see commit log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants