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

Breaking change identify event on PlatformAccessory #2551

Closed
ebaauw opened this issue Apr 30, 2020 · 1 comment
Closed

Breaking change identify event on PlatformAccessory #2551

ebaauw opened this issue Apr 30, 2020 · 1 comment
Labels

Comments

@ebaauw
Copy link
Contributor

ebaauw commented Apr 30, 2020

Describe The Bug:

The signature of the identify event from PlatformAccessory has changed. I think with the refactor of Homebridge to typescript.

The event used to be emitted as:

this.emit('identify', paired, callback);

but now it's:

this.emit(PlatformAccessoryEvent.IDENTIFY, () => {}); // empty callback for backwards compatibility

The paired parameter is missing.

This causes a TypeError for (dynamic platform) plugins calling the callback as second argument, see ebaauw/homebridge-zp#134.

To Reproduce:

Press ID in Eve, or pair the accessory in Home.

Expected behavior:

Backwards compatibility or explicitly documented as breaking change.

Environment:

  • Node.js Version: v12.16.3
  • NPM Version: v6.14.4
  • Homebridge Version: v1.0.3
@ebaauw ebaauw added the bug label Apr 30, 2020
@Supereg
Copy link
Member

Supereg commented May 1, 2020

Thanks for noticing, was corrected in cfe4d2e.

Is currently published as homebridge@1.0.5-beta.1.

If you want to keep backwards compatibility with your homebridge-lib plugin (for homebridge instances running a version < 1.0.0) you may want revert to still calling that callback.

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

No branches or pull requests

2 participants