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
Remove global limit on white light temperature #7206
Remove global limit on white light temperature #7206
Conversation
Here are the supported temperatures of some popular bulbs: Philips Hue: 2000K-6500K (the current 500-154 mired range) LIFX Color 1000: 2500K-9000K IKEA TRÅDFRI: 2200K, 2700K, 4000K Obviously, Home Assistant cannot enforce a global limit and work properly with all of these bulbs. So just remove the limit and leave it up to each platform to work it out. This commit updates the existing users and adds a clamp to Hue (where the limit appears to have originated). It does not attempt to update other platforms that might need extra handling of the larger range that is now possible.
This should solve the issue of LIFX commands with color temps above 6500K being ignored, and looks like it sets Hue bulbs to 6500K in the event a command is sent with a higher temp. Given that, the changes I made in home-assistant/frontend#243 should work to update the temp slider ranges in the UI. |
I don't think any change to this logic makes sense unless there is a plan in place for the frontend. I think the easiest step forward at the moment is to broaden the hass range to support all platforms, (so 2000K-9000K), and update the frontend respectively. (So use @cgrin's PR) Individual platforms can then apply their own clamps where required. |
That could also work, though I think it is odd to enforce a range that is wrong in every single case. In that case I would rather not enforce anything (just like How about a |
I prefer platforms to get properties |
I will add the attributes that @balloob suggests. Hopefully someone else can do the frontend. As you can have a group of lights with different ranges, I think my initial commit still makes sense. It is just impossible for the core to do the check. |
"""Return the warmest color_temp that this light supports.""" | ||
# The 3 LIFX "White" products supported a limited temperature range | ||
# https://lan.developer.lifx.com/docs/lifx-products | ||
if self.product in [ 10, 11, 18 ]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace after '['
whitespace before ']'
"""Return the coldest color_temp that this light supports.""" | ||
# The 3 LIFX "White" products supported a limited temperature range | ||
# https://lan.developer.lifx.com/docs/lifx-products | ||
if self.product in [ 10, 11, 18 ]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace after '['
whitespace before ']'
c436b2b
to
753abd1
Compare
753abd1
to
37c2298
Compare
I added global and LIFX |
Bueno! 🐬 |
Can we update the documentation on how to use min_mireds and max_mireds too? I can do it if you give me an example |
@ajma There is nothing to update, these are internal values like for example |
Description:
Here are the supported temperatures of some popular bulbs:
Philips Hue: 2000K-6500K (the current 500-154 mired range)
LIFX Color 1000: 2500K-9000K
IKEA TRÅDFRI: 2200K, 2700K, 4000K
Obviously, Home Assistant cannot enforce a global limit and work properly
with all of these bulbs. So just remove the limit and leave it up to each
platform to work it out.
This commit updates the existing users and adds a clamp to Hue (where the
limit appears to have originated). It does not attempt to update other
platforms that might need extra handling of the larger range that is now
possible.
The UI also has a hardcoded range for the temperature and it would probably be good to scale it to the supported range of the current bulb. Unfortunately, that range is generally unknown.
@cgrin @armills what do you think of this?
Related issue (if applicable): fixes #6606
Checklist:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests pass