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

Use homebridge v2.0 dynamic platform accessories #1

Open
ebaauw opened this issue Nov 20, 2016 · 2 comments
Open

Use homebridge v2.0 dynamic platform accessories #1

ebaauw opened this issue Nov 20, 2016 · 2 comments

Comments

@ebaauw
Copy link
Owner

ebaauw commented Nov 20, 2016

Currently, homebridge-zp uses static platform accessories. Using dynamic accessories would enable homebirdge-zp to act on ZoneGroupTopology events (e.g. creating or breaking a stereo pair) without having to restart homebridge.

ebaauw pushed a commit that referenced this issue May 30, 2019
ebaauw added a commit that referenced this issue Jul 17, 2019
Complete refactor to homebridge-zp, based on homebridge-lib to use the dynamic platform accessory model.  See #1.

Should also fix #81.

Still work in progress.  Todo:
- Handle topology changes (e.g. create/split stereo pair);
- Handle changed alarms (e.g. move to different zone);
- Hanlde changed config.json (e.g. no longer expose LEDs).
- Handle heartbeat 0 for LEDs to disable polling and use getter.

Need improvements to homebridge-lib:
- Startup sequence seems stable, but feels wrong.  Probably should do synchronous creation of delegates vs asynchronous initialisation.
- Remove accessory, service, characteristic when no longer needed.
- Still issue with name change - simply remove/re-create?
- Double-check tr/catch for every async call.
@ebaauw
Copy link
Owner Author

ebaauw commented Jul 23, 2019

[email protected] uses dynamic platform accessories. New zone player should be exposed automatically, but missing zone players will propably stick around. When leds is set in config.json, slave and satellite zone players are exposed as separate accessories, with only a LightBulb service. Enabling the physical controls is now also support (as Child Lock in Eve, in the accessory screen).

Changes to alarms are detected run time, moving the service to a different accessory, when a different zone (room) has been selected.

@ebaauw
Copy link
Owner Author

ebaauw commented Aug 4, 2019

Still to do:

  • Don't lose HomeKit accessories after clearing out cachedAccessories. Technically: delay starting of Homebridge's HAP server, until zone players have been discovered and accessories (re-) created. In v1.0.9.
  • Handle bonding of zone players (creating/breaking stereo pairs, home theatre setups);
  • Handle changed service type (and characteristic type) in config.json, preserving cached data. Technically: persist service values under key instead of UUID;
  • Handle removal of accessories (at least for zone players that are now bonded). What about missing zone players?
  • Double-check handling reboot of zone player (need to re-subscribe to events); In v1.1.3.
  • Double-check handling changed IP address of zone player; In v1.0.30.
  • Double-check handling powering down a zone player - need to mark them unreachable (expose Status Fault for that, like homebridge-hue?). Status Fault and improved re-subscribe logic in v1.4.0-4.
  • Only subscribe to ContentDirectory and AlarmService events from one (the "associated") zone player, cf. the Sonos app. Switch associated zone player when previous one goes missing. In v1.4.0-4.
  • TV inputs AirPlay, Audio In, and TV In to work on zone rather than on zone group. In v1.0.13.

ebaauw added a commit that referenced this issue Sep 6, 2019
TV inputs `AirPlay`, `Audio In`, and `TV In` to work on zone rather than on zone group, see #1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant