-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Pushing 'identify accessory' multiple times causes unhandled exception #2548
Comments
Which version of homebridge are you running if I may ask? Look at the stack trace I assume you are running homebridge. For what type of plugin does this occur, accessory or platform. It may be helpful if you could provide the plugin for which this caused the error. |
@Superreg - homebridge 1.0.2. The plug-in that this happens with isn't released yet, but I was assuming it wasn't plug-in specific. If you can't reproduce on an arbitrary plug-in, I'll try to create a minimal example. The plug-in doesn't hook the 'identify' event in any way. |
Alright, I gonna have a look at it tomorrow. |
@adriancable Can you share your code? ie check in to GitHub and share the REPO. |
@NorthernMan54 - unfortunately I'd rather not - the plug-in that's under development has some proprietary bits that I can't share. If @Supereg can't simply reproduce, I'll try and produce a minimal example that demonstrates the issue. |
Someone has reported the same issue with homebridge-nest here: #2542 |
The issue with the nest plugin is actually caused by some weird implementation of the plugin itself. See chrisjshull/homebridge-nest#245 Don't know if your issue somehow has a similar root cause. The nest issue is more related to homebridge and not to hap-nodejs. Would be great if you could check if that's the same issue or if it's something else. And also check to what it is related, if it's a homebridge problem we may move this issue to the homebridge repo. |
As the issue that was fixed in homebridge@1.0.4-beta.2 (or rather mitigated) was caused by a malformed StaticPlatformPluign or AccessoryPlugin I would be very interested in the way your specific code causes the issue for you. |
Describe The Bug:
When adding an accessory, there is an 'Identify Accessory' button presented by iOS Home app. Pressing it multiple times caused an unhandled exception in Accessory.ts line 262 (the callback call inside _identificationRequest, underneath the 'identification request ignored' line).
To Reproduce:
See above.
Expected behavior:
No exception.
Logs:
Error: This callback function has already been called by someone else; it can only be called one time.
at /root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:6:13
at Accessory._this._identificationRequest (/root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:262:7)
at Identify. (/root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:248:16)
at Identify.emit (events.js:323:22)
at Identify.EventEmitter.emit (/root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)
at Identify.Characteristic._this.setValue (/root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:614:12)
at /root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1441:24
at Array.forEach ()
at Bridge.Accessory._this._handleSetCharacteristics (/root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1283:10)
at HAPServer.emit (events.js:311:20)
Environment:
The text was updated successfully, but these errors were encountered: