Skip to content

Commit f7788e3

Browse files
committed
Updating libraries to newer versions, changing API endpoint for bridge discovery, fixing #126and modifying tests
1 parent e0a12dd commit f7788e3

13 files changed

+1015
-206
lines changed

hue-api/bridge-discovery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports.networkSearch = function (timeout) {
2828
* @returns {Q.promise} A promise that will resolve the addresses of the bridges, or {null} if a callback was provided.
2929
*/
3030
module.exports.locateBridges = function (cb) {
31-
var promise = http.invoke(discovery.upnpLookup, {host: "www.meethue.com", ssl: true});
31+
var promise = http.invoke(discovery.upnpLookup, {host: "discovery.meethue.com", ssl: true});
3232
return utils.promiseOrCallback(promise, cb);
3333
};
3434

hue-api/commands/discovery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ apiTraits.description = Trait.compose(
2020

2121
apiTraits.upnpLookup = Trait.compose(
2222
tApiMethod(
23-
"/api/nupnp",
23+
"/",
2424
"GET",
2525
"1.0",
2626
"All"

hue-api/index.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,20 +1000,20 @@ HueApi.prototype.recallScene = HueApi.prototype.activateScene;
10001000
//};
10011001

10021002

1003-
/**
1004-
* Obtains all the allowed timezones from the bridge.
1005-
*
1006-
* @param cb An optional callback function to use if you do not want to use a promise for the results.
1007-
* @return {*} A promise that will return the id of the scene that was created, or null if a callback was provided.
1008-
*/
1009-
HueApi.prototype.getTimezones = function (cb) {
1010-
var options = this._defaultOptions()
1011-
, promise = http.invoke(infoApi.getAllTimezones, options)
1012-
;
1013-
1014-
return utils.promiseOrCallback(promise, cb);
1015-
};
1016-
HueApi.prototype.timezones = HueApi.prototype.getTimezones;
1003+
// /**
1004+
// * Obtains all the allowed timezones from the bridge.
1005+
// *
1006+
// * @param cb An optional callback function to use if you do not want to use a promise for the results.
1007+
// * @return {*} A promise that will return the id of the scene that was created, or null if a callback was provided.
1008+
// */
1009+
// HueApi.prototype.getTimezones = function (cb) {
1010+
// var options = this._defaultOptions()
1011+
// , promise = http.invoke(infoApi.getAllTimezones, options)
1012+
// ;
1013+
//
1014+
// return utils.promiseOrCallback(promise, cb);
1015+
// };
1016+
// HueApi.prototype.timezones = HueApi.prototype.getTimezones;
10171017

10181018

10191019
////////////////////////////////////////////////////////////////////////////////////////////////

hue-api/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ SSDPSearch.prototype.search = function search() {
6060
var ip = "239.255.255.250",
6161
port = 1900;
6262

63-
var pkt = new Buffer(_buildSearchPacket(
63+
var pkt = Buffer.from(_buildSearchPacket(
6464
{
6565
"HOST": ip + ":" + port,
6666
"MAN": "ssdp:discover",

0 commit comments

Comments
 (0)