File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,25 @@ var Service = require('./lib/Service.js').Service;
4
4
var Characteristic = require ( './lib/Characteristic.js' ) . Characteristic ;
5
5
var uuid = require ( './lib/util/uuid' ) ;
6
6
var AccessoryLoader = require ( './lib/AccessoryLoader.js' ) ;
7
+ var storage = require ( 'node-persist' ) ;
7
8
8
9
// ensure Characteristic subclasses are defined
9
10
var HomeKitTypes = require ( './lib/gen/HomeKitTypes' ) ;
10
11
11
12
module . exports = {
13
+ init : init ,
12
14
Accessory : Accessory ,
13
15
Bridge : Bridge ,
14
16
Service : Service ,
15
17
Characteristic : Characteristic ,
16
18
uuid : uuid ,
17
19
AccessoryLoader : AccessoryLoader
20
+ }
21
+
22
+ function init ( storagePath ) {
23
+ // initialize our underlying storage system, passing on the directory if needed
24
+ if ( typeof storagePath !== 'undefined' )
25
+ storage . initSync ( { dir : storagePath } ) ;
26
+ else
27
+ storage . initSync ( ) ; // use whatever is default
18
28
}
You can’t perform that action at this time.
0 commit comments