-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
New Release 3.1.1 #737
New Release 3.1.1 #737
Conversation
added more tests and diagnostic feature bump to plugp100 5.0.0 feat(core): bump to plugp100 5.0.0
if device.is_color: | ||
color_modes.append(ColorMode.HS) | ||
if device.is_brightness and not device.is_color_temperature and not device.is_color: | ||
color_modes.append(ColorMode.BRIGHTNESS) |
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.
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.
The code follows the HA algorithm describe here https://developers.home-assistant.io/docs/core/entity/light/#color-modes. Don't you agree?
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.
That's also the resource where my screenshot is from.
So this is not correct, as in the current implementation you have now there could potentially be scenarios where brightness
could be mixed with other color modes in the supported_color_modes
, but it has to be the only one.
See also the explanation how to correctly determine the color modes:
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.
The if
has the and not device.is_color_temperature and not device.is_color
so cannot be mixed with other color modes. No?
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.
Yes, I see you are correct about that.
However I see potential issue with the last condition:
if not device.is_color_temperature and not device.is_color:
color_modes.append(ColorMode.ONOFF)
This does not check for brightness
.
So you'll end up with brightness, onoff
as supported color modes, which is not valid.
Maybe rewrite to:
if not color_modes:
color_modes.append(ColorMode.ONOFF)
Similarly as HA suggests in their approach.
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.
Ok, now It's clear and I agree with you
🎉 This PR is included in version 3.1.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
No description provided.