Skip to content

Commit

Permalink
Fixes #97 adding an implicit default to recycle payload value in scen…
Browse files Browse the repository at this point in the history
…e creation
  • Loading branch information
peter-murray committed Oct 10, 2016
1 parent 9f0dddb commit 37c527c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hue-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,8 @@ HueApi.prototype.createBasicScene = function (lightIds, name, cb) {

options.values = {
name: name,
lights: utils.createStringValueArray(lightIds)
lights: utils.createStringValueArray(lightIds),
recycle: false
};

promise = http.invoke(scenesApi.createScene, options);
Expand All @@ -758,11 +759,12 @@ HueApi.prototype.createBasicScene = function (lightIds, name, cb) {
HueApi.prototype.createAdvancedScene = function(scene, cb) {
var self = this
, options = self._defaultOptions()
, myScene = deepExtend({recycle: false}, scene)
, promise
;

//TODO validate the options object
options.values = scene;
options.values = myScene;

promise = http.invoke(scenesApi.createScene, options);
return utils.promiseOrCallback(promise, cb);
Expand Down

0 comments on commit 37c527c

Please sign in to comment.