forked from ItKindaWorks/HAP-NodeJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
28 lines (25 loc) · 906 Bytes
/
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
var Accessory = require('./lib/Accessory.js').Accessory;
var Bridge = require('./lib/Bridge.js').Bridge;
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 storage = require('node-persist');
// ensure Characteristic subclasses are defined
var HomeKitTypes = require('./lib/gen/HomeKitTypes');
module.exports = {
init: init,
Accessory: Accessory,
Bridge: Bridge,
Service: Service,
Characteristic: Characteristic,
uuid: uuid,
AccessoryLoader: AccessoryLoader
}
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
}