Open cydrobolt opened 8 years ago
Based on the lifx
API doc, the value of power
is fine but brightness
should be Double. Try sending the value a Double value:
Also, currently ya-lifx
set a default value on all the params but from the Documentation none of them are required (I'm working on fixing this).
lifx.setState({
'color': color_hex,
'brightness': 0.2
})
.then(function (r) {
console.log(r);
})
.fail(function(e) {
console.log(e);
});
@mdottavio thanks. No defaults would be great.
Hi @cydrobolt, sorry about the delay; I'm working to validate those values on the branch fixing_validations
but I also want to include some unit tests to the project; so it may take some time until I can release a stable version;
in the meantime you can consume the branch from NPM with:
npm install git://github.com/mdottavio/ya-lifx#fixing_validations --save
and see if this solution solve your problem.
Let me know if you find something else 👍
Seems like aState.power
is referenced elsewhere, throwing an error.
@mdottavio any updates?
@cydrobolt I just release v2.0.0
which I think fixe the issue;
If you find something else, please include as much details about the issue as you can so I can try to fix it;
Thanks
I'm getting the same error. Does it work on your end? @mdottavio
@cydrobolt are you still interested in using this lib? 😞 here is a new version. https://github.com/mdottavio/ya-lifx/tree/mdottavio_nodefetch do you mind verifying if the problem persists using this version?
When performing a
setState
, I am getting some errors that are preventing me from setting the state of the bulb. Notably, this error occurs:Object {error: "power does not have a valid value, brightness does not have a valid value", warnings: Object}
I am using the following code:
color_hex
is a hex string for the color to set. Is there a way to fix this error, and be able to set state without providing each argument (i.e leave brightness + power state intact)?