forked from homebridge/HAP-NodeJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (31 loc) · 1.14 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var Accessory = require('./lib/Accessory.js').Accessory;
var Bridge = require('./lib/Bridge.js').Bridge;
var Camera = require('./lib/Camera.js').Camera;
var Service = require('./lib/Service.js').Service;
var Characteristic = require('./lib/Characteristic.js').Characteristic;
var uuid = require('./lib/util/uuid');
var AccessoryLoader = require('./lib/AccessoryLoader.js');
var StreamController = require('./lib/StreamController.js').StreamController;
var storage = require('node-persist');
var HAPServer = require('./lib/HAPServer').HAPServer;
// ensure Characteristic subclasses are defined
var HomeKitTypes = require('./lib/gen/HomeKitTypes');
module.exports = {
init: init,
Accessory: Accessory,
Bridge: Bridge,
Camera: Camera,
Service: Service,
Characteristic: Characteristic,
uuid: uuid,
AccessoryLoader: AccessoryLoader,
StreamController: StreamController,
HAPServer: HAPServer
}
function init(storagePath) {
// initialize our underlying storage system, passing on the directory if needed
if (typeof storagePath !== 'undefined')
storage.initSync({ dir: storagePath });
else
storage.initSync(); // use whatever is default
}