forked from kiwi-cam/homebridge-broadlink-rm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
19 lines (14 loc) · 735 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const BroadlinkRMPlatform = require('./platform');
const compareVersions = require('compare-versions');
const fakegatoHistory = require( 'fakegato-history');
module.exports = (homebridge) => {
if (compareVersions("0.4.47", homebridge.serverVersion) > 0) {
console.log(`[Broadlink RM] The plugin homebridge-broadlink-rm requires HomeBridge v0.4.47 or higher! You have: ${homebridge.serverVersion}.`);
process.exit(1);
}
HistoryService = fakegatoHistory( homebridge );
global.Service = homebridge.hap.Service;
global.Characteristic = homebridge.hap.Characteristic;
BroadlinkRMPlatform.setHomebridge(homebridge);
homebridge.registerPlatform("homebridge-broadlink-rm", "BroadlinkRM", BroadlinkRMPlatform);
}