Skip to content

Commit

Permalink
- Fixes #46, the scene parameter was not being passed through to the …
Browse files Browse the repository at this point in the history
…bridge when activating a scene
  • Loading branch information
osirisoft-pmurray committed Feb 8, 2015
1 parent 4a51ffd commit 7303cb3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## 1.0.5
- Fixes issue #46 scene id was missing from body sent to the bridge for activation requests

## 1.0.4
- Fixes issue #45 creating a scene resulted in a NaN id for the scene created

Expand Down
14 changes: 14 additions & 0 deletions hue-api/lightstate.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ State.prototype.transitiontime = function (value) {
return this;
};

State.prototype.scene = function (value) {
this._addValues(_getSceneId(value));
return this;
}


///////////////////////////////////////////////////////////////////////
// Convenience functions
Expand Down Expand Up @@ -414,6 +419,15 @@ function _getTransitionState(value) {
};
}

function _getSceneId(value) {
var result = {};

if (value) {
result.scene = value;
}
return result;
}

function _getWhiteState(colorTemp, brightness) {
return utils.combine(
_getCtState(colorTemp),
Expand Down

0 comments on commit 7303cb3

Please sign in to comment.