Skip to content
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

Merged
merged 1 commit into from
Apr 10, 2019
Merged

Add color setting trait #22894

merged 1 commit into from
Apr 10, 2019

Conversation

balloob
Copy link
Member

@balloob balloob commented Apr 8, 2019

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:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly (example).
  • New dependencies have been added to requirements in the manifest (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

response = {}

if features & light.SUPPORT_COLOR:
response['colorModel'] = 'rgb'
Copy link
Member

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.

Copy link
Member Author

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
Copy link

codecov bot commented Apr 8, 2019

Codecov Report

Merging #22894 into dev will decrease coverage by 0.01%.
The diff coverage is 97.43%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
homeassistant/components/google_assistant/trait.py 96.1% <97.43%> (-0.27%) ⬇️
homeassistant/components/mqtt/climate.py 99.43% <0%> (-0.07%) ⬇️
homeassistant/components/mqtt/binary_sensor.py 100% <0%> (ø) ⬆️
homeassistant/components/mqtt/vacuum.py 92.46% <0%> (ø) ⬆️
homeassistant/components/mqtt/sensor.py 100% <0%> (ø) ⬆️
homeassistant/components/mqtt/cover.py 94.07% <0%> (ø) ⬆️
homeassistant/components/hassio/ingress.py 71.3% <0%> (ø) ⬆️
...meassistant/components/mqtt/alarm_control_panel.py 99.26% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 49a2f5a...631ad0f. Read the comment docs.

@balloob balloob merged commit 51e6d53 into dev Apr 10, 2019
@ghost ghost removed the in progress label Apr 10, 2019
@delete-merged-branch delete-merged-branch bot deleted the color-setting-trait branch April 10, 2019 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Assistant: Migrate to new color trait
3 participants