-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adding new function names to add clarity to the types of discovery …
…offered and match them up to the Hue API documentation
- Loading branch information
1 parent
ad82fd1
commit 4ba2126
Showing
2 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,35 @@ | ||
"use strict"; | ||
|
||
var bridgeDiscovery = require("./hue-api/bridge-discovery"); | ||
|
||
// | ||
// This wrapper is to provide some continuity in the modifications of the APIs over time | ||
// | ||
|
||
module.exports.HueApi = require("./hue-api/index.js"); | ||
|
||
module.exports.locateBridges = require("./hue-api/bridge-discovery").locateBridges; | ||
module.exports.searchForBridges = require("./hue-api/bridge-discovery").networkSearch; | ||
module.exports.locateBridges = _deprecated( | ||
bridgeDiscovery.locateBridges | ||
, "'locateBridges' is deprecated, please use 'nupnpSearch' instead" | ||
); | ||
module.exports.nupnpSearch = bridgeDiscovery.locateBridges; | ||
|
||
module.exports.searchForBridges = _deprecated( | ||
bridgeDiscovery.networkSearch | ||
, "'searchForBridges' is deprecated, please use 'upnpSearch' instead" | ||
); | ||
module.exports.upnpSearch = bridgeDiscovery.networkSearch; | ||
|
||
module.exports.lightState = require("./hue-api/lightstate.js"); | ||
module.exports.scheduledEvent = require("./hue-api/scheduledEvent.js"); | ||
module.exports.ApiError = require("./hue-api/errors.js").ApiError; | ||
module.exports.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); | ||
} | ||
} |