jangxx / node-magichome

An incomplete implementation of the functionality of the "Magic Home" app. Partially a port of https://github.com/Danielhiversen/flux_led to Node.js
ISC License
124 stars 26 forks source link

Fix setWhites function bug #25

Closed egold555 closed 4 years ago

egold555 commented 4 years ago

Fix for the setWhites function not setting the warm white to the correct passed in value.

jangxx commented 4 years ago

Have you verified this works with one of your own bulbs? The current implementation works under the assumption, that bulbs can not change their warm white and cold white at the same time, so in case you have a bulb, you're supposed to use setWarmWhite to set the warm white value and setWhites to set the cold white value. Also, can you please describe the problem you're solving with this a bit more?

egold555 commented 4 years ago

Hi. I think I might have misunderstood exactly what it is suppose to do, but least for the bulbs I am using, you can set the warm and cold white at the same time.

I was under the impression that setWhites would set the warm and cold at the same time (I didn't know that most bulbs you can't do this with, I only have one set of lights I got off of Amazon)

Here are the bulbs I am using: https://www.amazon.com/BERENNIS-Dimmable-Multicolored-Required-Compatible/dp/B07GGWNQT7

If this breaks anything for other users please just close the issue, its no big deal. I just thought it was a copy and paste error because apparently my lights are special and you can set the warm and cold at the same time.

jangxx commented 4 years ago

I might have misremembered some things from the discussion about issue https://github.com/jangxx/node-magichome/issues/24. I thought there was some limitation, but I think you might be right, and this might actually be a copy&paste error. I will merge your PR, put it in the next version and if someone runs into a problem they can open a new issue I guess.