Skip to content

Fix Min/Max Kelvin color temp attribute for Google#15697

Merged
balloob merged 3 commits intohome-assistant:devfrom
bryanyork:patch-2
Aug 2, 2018
Merged

Fix Min/Max Kelvin color temp attribute for Google#15697
balloob merged 3 commits intohome-assistant:devfrom
bryanyork:patch-2

Conversation

@bryanyork
Copy link
Copy Markdown
Contributor

@bryanyork bryanyork commented Jul 26, 2018

Max Kelvin is actually Min Mireds and vice-versa. K = 1000000 / mireds

Description:

When the refactor for google_assistant and some additional color_util changes were done, there was an oversight in the reported Kelvin attribute for Google Assistant. The maximum kelvin is actually the minimum mireds and vice-versa. This caused the color temperature for white to skew towards super warm when utilizing Google Assistant. This PR fixes this.

Related issue (if applicable): fixes #14364

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.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

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

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

  • New dependencies have been added to the REQUIREMENTS variable (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.

Max Kelvin is actually Min Mireds and vice-versa. K = 1000000 / mireds
@bryanyork
Copy link
Copy Markdown
Contributor Author

@balloob Since you wrote the refactor, you might be the best person to review this?

@balloob
Copy link
Copy Markdown
Member

balloob commented Aug 2, 2018

Thanks!

@balloob balloob merged commit 38928c4 into home-assistant:dev Aug 2, 2018
@ghost ghost removed the in progress label Aug 2, 2018
@balloob balloob added this to the 0.75 milestone Aug 2, 2018
balloob pushed a commit that referenced this pull request Aug 3, 2018
* Fix Min/Max Kelvin color temp attribute for Google

Max Kelvin is actually Min Mireds and vice-versa. K = 1000000 / mireds

* Update test_smart_home.py

* Update test_trait.py
@balloob balloob mentioned this pull request Aug 3, 2018
@duffrecords
Copy link
Copy Markdown

In my Home Assistant / Google Assistant setup, the color temperature still seems to be reversed. i.e. asking Google to set the lights to "daylight" or "soft white" results in warm/soft white, whereas asking it to set the lights to "candlelight" results in cool white. I'm using 0.76.2.

@bryanyork
Copy link
Copy Markdown
Contributor Author

@duffrecords You should probably open an issue as merged PR's aren't a method of support. However please try unlinking and relinking the skill. Had to do that for this change to take effect

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Aug 27, 2018
@bryanyork bryanyork deleted the patch-2 branch April 28, 2019 00:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting color temperature using Google Assistant always sets the color to super warm white

4 participants