From 37c527c6a589db99deaa3e6c3c18d4dceabae42a Mon Sep 17 00:00:00 2001 From: Peter Murray Date: Mon, 10 Oct 2016 21:14:14 +0100 Subject: [PATCH] Fixes #97 adding an implicit default to recycle payload value in scene creation --- hue-api/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hue-api/index.js b/hue-api/index.js index 8ca02a9..999c141 100644 --- a/hue-api/index.js +++ b/hue-api/index.js @@ -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); @@ -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);