Skip to content

Commit

Permalink
Dynamic platform accessories
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ebaauw committed Jul 17, 2019
1 parent 3c4901c commit f033ab0
Show file tree
Hide file tree
Showing 5 changed files with 1,235 additions and 1,934 deletions.
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@

'use strict'

const ZpPlatformModule = require('./lib/ZpPlatform')
const ZpPlatform = ZpPlatformModule.ZpPlatform
const ZpPlatform = require('./lib/ZpPlatform')
const packageJson = require('./package.json')

module.exports = (homebridge) => {
ZpPlatformModule.setHomebridge(homebridge)
homebridge.registerPlatform('homebridge-zp', 'ZP', ZpPlatform)
ZpPlatform.loadPlatform(homebridge, packageJson, 'ZP', ZpPlatform)
}
Loading

0 comments on commit f033ab0

Please sign in to comment.