forked from peter-murray/node-hue-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
49 lines (37 loc) · 1.2 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
"use strict";
//
// This wrapper is to provide some continuity in the modifications of the APIs over time
//
var bridgeDiscovery = require("./hue-api/bridge-discovery")
, Hue = require("./hue-api")
, lightState = require("./hue-api/lightstate")
, scheduledEvent = require("./hue-api/scheduledEvent.js")
, ApiError = require("./hue-api/errors.js").ApiError
;
function deprecated(fn, message) {
return function () {
var args = Array.prototype.slice.call(arguments);
console.error(message);
return fn.apply(this, args);
};
}
module.exports = {
HueApi: Hue,
BridgeApi: Hue,
api: Hue,
//TODO document this
connect: function(config) {
return new Hue(config);
},
lightState: lightState,
scheduledEvent: scheduledEvent,
upnpSearch: bridgeDiscovery.networkSearch,
nupnpSearch: bridgeDiscovery.locateBridges,
locateBridges: deprecated(bridgeDiscovery.locateBridges
, "'locateBridges' is deprecated, please use 'nupnpSearch' instead"),
searchForBridges: deprecated(
bridgeDiscovery.networkSearch
, "'searchForBridges' is deprecated, please use 'upnpSearch' instead"
),
ApiError: ApiError
};