-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor the kelvin handling. #18
Comments
There is a small opstacle. The discovered devices does not contain any device type parameters today. They have to recovered manualy. |
I like that idea. To confirm, are you saying the device discovery process, which returns a "light" should also statically return the type of light on the main object? A little confused about your question. Are you asking if other functions don't have a device type? |
@mabels I've known for a long time this ought to be done. The kelvin values (+ other info) can be found in src/lifx/products.json. The file is maintained by LIFX and can be found here github.com/LIFX/products/blob/master/products.json. I'm not sure if the current version is up-to-date but it seems to have Tiles at least so it might be the latest. |
I read too fast. So the issue was that the current discovery process does not do the request that would give the light type? Extending the process to do this would then be a good idea. Although I have a faint memory that at some point there was an issue that some lights didn't respond to the |
Sorry for nosing around ^^ |
@Shakesbeard This could be a valid approach especially if for example the older lights do not respond to the query (they all had 2500-9000K range). I'm sadly lacking time to do much work for this library at the moment. I have an idea. If someone's got the time, it would be useful to have a snippet of code that would first discover the lights then do a hardware query for each and in the end print out the result in a compact list. This way it would be easy for all participants in this thread to test it on their setup. With the result we'd get better info if there still are issues with the hardware query on the current firmware and better discuss the strategy in solving this. I would have lights ranging from the first E27 bulbs to most newer EU market products: E27 IR bulb, newer E27 classic bulbs, E27 Mini Color bulbs, Z Strips, GU10 downlights and a Tile set to test with. Naturally I'm missing all the US models. |
BTW, I've been using the 1500-9000K range for all my lights for months now without any issues. The lights that don't support values between 1500-2499 just pick the closest value on the firmware level and change to that. I think this greatly simplifies implementing custom user interfaces as you can just use the same range for all lights. This seems to be what the LIFX app UI also does when controlling a group of lights with mixed color temp capabilities. It's easy to think unnecessary packets could be avoided by blocking the requests to an unsupported range but the end user would still arguably want the light to change to at least 2500K if 1500K is requested. As far as I see it, from the library perspective the only use for this improvement would then be to try to map let's say 1500K to 2500K if that is the lowest value the light supports. But would it be just waste if this is already done on the hardware level? The downside of this would also be additional |
Hmm.. I only do that until I once succesfully received the hardware info from the device. Then I store the values in my app and never rerequest the info until complete restart. |
I implemented the hardware info call in my app too and can confirm that sometimes the response ends up to be empty. However, I simply rerequest the info until I got it and only then I flag the device as operational. |
The kelvin validation should make use of the configuration of the device.
The text was updated successfully, but these errors were encountered: