Skip to content

Commit

Permalink
Support for homebridge.user.storagePath()
Browse files Browse the repository at this point in the history
  • Loading branch information
lprhodes committed Mar 23, 2018
1 parent d142013 commit 7cbc29d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ module.exports = (homebridge) => {
global.Service = homebridge.hap.Service;
global.Characteristic = homebridge.hap.Characteristic;

BroadlinkRMPlatform.setHomebridge(homebridge);

homebridge.registerPlatform("homebridge-broadlink-rm", "BroadlinkRM", BroadlinkRMPlatform);
}
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"broadlinkjs-rm": "^0.5.3",
"chai": "^4.1.2",
"github-version-checker": "^1.2.0",
"homebridge-platform-helper": "1.0.6",
"homebridge-platform-helper": "1.0.7",
"ping": "^0.2.2",
"uuid": "^3.2.1"
},
Expand Down
10 changes: 10 additions & 0 deletions platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ const classTypes = {
'window-covering': Accessory.WindowCovering,
}

let homebridgeRef

const BroadlinkRMPlatform = class extends HomebridgePlatform {

constructor (log, config = {}) {
super(log, config, homebridgeRef);
}

addAccessories (accessories) {
const { config, log } = this;

Expand Down Expand Up @@ -121,4 +127,8 @@ const BroadlinkRMPlatform = class extends HomebridgePlatform {
}
}

BroadlinkRMPlatform.setHomebridge = (homebridge) => {
homebridgeRef = homebridge
}

module.exports = BroadlinkRMPlatform

0 comments on commit 7cbc29d

Please sign in to comment.