-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Add color setting trait #22894
Add color setting trait #22894
Conversation
response = {} | ||
|
||
if features & light.SUPPORT_COLOR: | ||
response['colorModel'] = 'rgb' |
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.
Might have missed a previous conversation about this, but: Why don't we use HSV here? I mean we use HSV ourselves internally.
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.
So right now I just migrated it. I glanced at it briefly, but I have to confess that I don't know how to convert our HS_COLOR attribute to HSV. If it's a simple fix and you know how to convert it, it's as simple as a dict having hue
, saturation
and value
: https://developers.google.com/actions/smarthome/traits/colorsetting#device-states , and then in execute also be able to deal with incoming spectrumHSV
attribute.
Codecov Report
@@ Coverage Diff @@
## dev #22894 +/- ##
==========================================
- Coverage 93.83% 93.82% -0.02%
==========================================
Files 448 448
Lines 36574 36525 -49
==========================================
- Hits 34321 34271 -50
- Misses 2253 2254 +1
Continue to review full report at Codecov.
|
Description:
Add the new color setting trait, which merges the color spectrum and color temperature trait into 1.
Related issue (if applicable): fixes #22675
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>
Example entry for
configuration.yaml
(if applicable):Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
requirements
in the manifest (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices: