forked from ebaauw/homebridge-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
171 lines (152 loc) · 5.51 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// homebridge-lib/index.js
//
// Library for Homebridge plugins.
// Copyright © 2017-2019 Erik Baauw. All rights reserved.
'use strict'
/** Library for Homebridge plugins.
* see the {@tutorial homebridge-lib} tutorial.
*
* `homebridge-lib` provides:
* - A series of base classes for building Homebridge dynamic platform plugins:
* {@link Platform},
* {@link AccessoryDelegate},
* {@link ServiceDelegate}, and
* {@link CharacteristicDelegate}.
* - A base class to building command-line tools:
* {@link CommandLineTool}.
* - A series of helper classes for building homebridge plugins (of any type)
* and/or command-line utilities:
* {@link CommandLineParser},
* {@link EveHomeKitTypes},
* {@link JsonFormatter},
* {@link MyHomeKitTypes},
* {@link OptionParser},
* {@link RestClient}, and
* {@link UpnpClient}.
* - A series of command-line utilities for troubleshooting Homebridge setups:
* `hap`, `json`, `upnp`.
* For more information on these, start the tool from the command-line
* with `-h` or `--help`.
*
* To access the classes provided by `homebridge-lib` from your module,
* simply load it by:
* ```javascript
* const homebridgeLib = require('homebridge-lib')
* ```
*
* Note that each class provided by `homebridge-lib` is implemented as a
* separate Javascript module, that is loaded lazily on first use.
* Due to the way NodeJS deals with circular module dependencies, these modules
* might not yet be initialised while your module is loading.
*
* @module homebridge-lib
*/
class homebridgeLib {
/** Abstract superclass for a Homebridge dynamic platform plugin.
* <br>See {@link Platform}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get Platform () { return require('./lib/Platform') }
/** Abstract superclass for a HomeKit accessory delegate.
* <br>See {@link AccessoryDelegate}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get AccessoryDelegate () { return require('./lib/AccessoryDelegate') }
/** Abstract superclass for a HomeKit service delegate.
* <br>See {@link ServiceDelegate}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get ServiceDelegate () { return require('./lib/ServiceDelegate') }
/** HomeKit characteristic delegate.
* <br>See {@link CharacteristicDelegate}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get CharacteristicDelegate () { return require('./lib/CharacteristicDelegate') }
/** Abstract superclass for {@link Platform}, {@link AccessoryDelegate},
* {@link ServiceDelegate}, and {@link CharacteristicDelegate}.
* <br>See {@link Delegate}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get Delegate () { return require('./lib/Delegate') }
/** Parser and validator for command-line arguments.
* <br>See {@link CommandLineParser}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get CommandLineParser () { return require('./lib/CommandLineParser') }
/** Abstract superclass for a command-line tool.
* <br>See {@link CommandLineTool}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get CommandLineTool () { return require('./lib/CommandLineTool') }
/** JSON formatter.
* <br>See {@link JsonFormatter}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get JsonFormatter () { return require('./lib/JsonFormatter') }
/** Parser and validator for options and other parameters.
* <br>See {@link OptionParser}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get OptionParser () { return require('./lib/OptionParser') }
/** REST API client.
* <br>See {@link RestClient}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get RestClient () { return require('./lib/RestClient') }
/** Universal Plug and Play client.
* <br>See {@link UpnpClient}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get UpnpClient () { return require('./lib/UpnpClient') }
/** Abstract superclass for {@link EveHomeKitTypes}
* and {@link MyHomeKitTypes}.
* <br>See {@link CustomHomeKitTypes}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get CustomHomeKitTypes () { return require('./lib/CustomHomeKitTypes') }
/** Custom HomeKit services and characteristics used by
* [Eve](https://www.evehome.com/en) accessories and by the
* [Eve app](https://www.evehome.com/en/eve-app).
* <br>See {@link EveHomeKitTypes}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get EveHomeKitTypes () { return require('./lib/EveHomeKitTypes') }
/** My own collection of custom HomeKit services and characteristics.
* <br>See {@link MyHomeKitTypes}.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get MyHomeKitTypes () { return require('./lib/MyHomeKitTypes') }
/** The `hap` command.
* <br> Issue `hap -h` for help.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get HapCommand () { return require('./lib/HapCommand') }
/** The `json` command.
* <br> Issue `json -h` for help.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get JsonCommand () { return require('./lib/JsonCommand') }
/** The `upnp` command.
* <br> Issue `upnp -h` for help.
* @type {Class}
* @memberof module:homebridge-lib
*/
static get UpnpCommand () { return require('./lib/UpnpCommand') }
}
module.exports = homebridgeLib