Skip to content

Commit

Permalink
Updating libraries to newer versions, changing API endpoint for bridg…
Browse files Browse the repository at this point in the history
…e discovery, fixing #126and modifying tests
  • Loading branch information
peter-murray committed May 19, 2019
1 parent e0a12dd commit f7788e3
Show file tree
Hide file tree
Showing 13 changed files with 1,015 additions and 206 deletions.
2 changes: 1 addition & 1 deletion hue-api/bridge-discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports.networkSearch = function (timeout) {
* @returns {Q.promise} A promise that will resolve the addresses of the bridges, or {null} if a callback was provided.
*/
module.exports.locateBridges = function (cb) {
var promise = http.invoke(discovery.upnpLookup, {host: "www.meethue.com", ssl: true});
var promise = http.invoke(discovery.upnpLookup, {host: "discovery.meethue.com", ssl: true});
return utils.promiseOrCallback(promise, cb);
};

Expand Down
2 changes: 1 addition & 1 deletion hue-api/commands/discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ apiTraits.description = Trait.compose(

apiTraits.upnpLookup = Trait.compose(
tApiMethod(
"/api/nupnp",
"/",
"GET",
"1.0",
"All"
Expand Down
28 changes: 14 additions & 14 deletions hue-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1000,20 +1000,20 @@ HueApi.prototype.recallScene = HueApi.prototype.activateScene;
//};


/**
* Obtains all the allowed timezones from the bridge.
*
* @param cb An optional callback function to use if you do not want to use a promise for the results.
* @return {*} A promise that will return the id of the scene that was created, or null if a callback was provided.
*/
HueApi.prototype.getTimezones = function (cb) {
var options = this._defaultOptions()
, promise = http.invoke(infoApi.getAllTimezones, options)
;

return utils.promiseOrCallback(promise, cb);
};
HueApi.prototype.timezones = HueApi.prototype.getTimezones;
// /**
// * Obtains all the allowed timezones from the bridge.
// *
// * @param cb An optional callback function to use if you do not want to use a promise for the results.
// * @return {*} A promise that will return the id of the scene that was created, or null if a callback was provided.
// */
// HueApi.prototype.getTimezones = function (cb) {
// var options = this._defaultOptions()
// , promise = http.invoke(infoApi.getAllTimezones, options)
// ;
//
// return utils.promiseOrCallback(promise, cb);
// };
// HueApi.prototype.timezones = HueApi.prototype.getTimezones;


////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion hue-api/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ SSDPSearch.prototype.search = function search() {
var ip = "239.255.255.250",
port = 1900;

var pkt = new Buffer(_buildSearchPacket(
var pkt = Buffer.from(_buildSearchPacket(
{
"HOST": ip + ":" + port,
"MAN": "ssdp:discover",
Expand Down
Loading

0 comments on commit f7788e3

Please sign in to comment.