-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Fix hue lights for Philips and non-philips lights
#8905
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
@groth-its, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @fabaff and @michaelarnauts to be potential reviewers. |
elif self.bridge_type == 'hue': | ||
if self.info.get('manufacturername') != "OSRAM": | ||
command['effect'] = 'none' | ||
elif self.bridge_type == 'hue' and self.info.get('manufacturername') == 'Philips': |
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 (90 > 79 characters)
@@ -384,7 +384,7 @@ def turn_on(self, **kwargs): | |||
hue, sat = color_util.color_xy_to_hs(*kwargs[ATTR_XY_COLOR]) | |||
command['hue'] = hue | |||
command['sat'] = sat | |||
command['bri'] = self.info['bri'] | |||
command['bri'] = self.info.get('bri') |
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.
I think this is setting the brightness to the value that HA has cached, right? Can we simply delete the line and the bulb will maintain the current brightness (but change its hue and saturation)?
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.
Valid point, thanks a lot. I took care of that.
Thanks 🐬 |
Description:
Fixes coding errors for getting current brightness state introduced when making the component compatible to OSRAM lights (#6122).
Since the original issue addressed in #6122 for OSRAM lights is also true for innr lights (they don't handle "effect": "none"), I decided to only set this parameter when a Philips light is controlled.
Lastly makes color temperature, xy and rgb all mutual exclusive.
Checklist:
tox
run successfully. Your PR cannot be merged unless tests pass