-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
RGB Tradfri simple support #9703
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
Conversation
from pytradfri.color import MIN_KELVIN_WS | ||
return color_util.color_temperature_kelvin_to_mired(MIN_KELVIN_WS) | ||
from pytradfri.color import MIN_KELVIN_WS, MIN_KELVIN | ||
min_kelvin = MIN_KELVIN if "CWS" in self._light.device_info.model_number else MIN_KELVIN_WS |
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.
line too long (99 > 79 characters)
from pytradfri.color import MAX_KELVIN_WS | ||
return color_util.color_temperature_kelvin_to_mired(MAX_KELVIN_WS) | ||
from pytradfri.color import MAX_KELVIN_WS, MAX_KELVIN | ||
max_kelvin = MAX_KELVIN if "CWS" in self._light.device_info.model_number else MAX_KELVIN_WS |
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.
line too long (99 > 79 characters)
self._features |= SUPPORT_RGB_COLOR | ||
|
||
if self._light_data.hex_color is not None and self._light.device_info.manufacturer != IKEA: |
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.
line too long (99 > 79 characters)
IMHO pytradfri should take care of cause of #9603. It should also detect bulb type and have different classes. I can take care of it (-: But as it will be bigger change, I wanted to share this one first. |
pytradfri might be the right place to determine the features but... The improvements are noticable for the everybody user (UI bulb icons responding to color changes and color picker where necessary). Both changes seem to work fine with current dev: |
|
||
@property | ||
def max_mireds(self): | ||
"""Return the warmest color_temp that this light supports.""" | ||
from pytradfri.color import MIN_KELVIN_WS | ||
return color_util.color_temperature_kelvin_to_mired(MIN_KELVIN_WS) | ||
return color_util.color_temperature_kelvin_to_mired(self._light_control.min_kelvin) |
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.
line too long (91 > 79 characters)
@@ -161,14 +161,12 @@ def __init__(self, light, api): | |||
@property | |||
def min_mireds(self): | |||
"""Return the coldest color_temp that this light supports.""" | |||
from pytradfri.color import MAX_KELVIN_WS | |||
return color_util.color_temperature_kelvin_to_mired(MAX_KELVIN_WS) | |||
return color_util.color_temperature_kelvin_to_mired(self._light_control.max_kelvin) |
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.
line too long (91 > 79 characters)
self._rgb_color = color_util.rgb_hex_to_rgb_list( | ||
self._light_data.hex_color) | ||
|
||
self._rgb_color = color_util.rgb_hex_to_rgb_list(self._light_data.hex_color_inferred) |
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.
line too long (93 > 79 characters)
Trying this PR out. The color picker works like a charm. Great work @matemaciek! |
Ping @lwis for merge. This PR runs on your pytradfri 3.0 (3.0.1 even.) |
Shouldn't this be 3.0.2? |
I forgot to make a release of 3.0.1 but pushed it as 3.0.1 to pypi. 3.0.2 is both a release and on pypi so yes, it might be better to use it? |
OK, I've bumped |
Thanks! 🐊 |
I'm on Home Assistant 0.56.2 (Hassio) and I can see only brightness and color temperature for my Tradfri RGB bulbs. Am I not on the latest version or is this not yet in the main line? |
@eddemans this should be in the next release, but was backed out in dev due to some issues. |
Description:
Simple support for RGB Tradfri lights. I intend to move detecting bulb type to pytradfri, so finaly this code will be much simpler. But let's allow people with RGB Tradfri to play with it now.
Checklist:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests pass