Skip to content

Migrate the LIFX integration to use kelvin for color temp#79775

Merged
bdraco merged 2 commits into
home-assistant:devfrom
Djelibeybi:lifx-kelvin
Oct 9, 2022
Merged

Migrate the LIFX integration to use kelvin for color temp#79775
bdraco merged 2 commits into
home-assistant:devfrom
Djelibeybi:lifx-kelvin

Conversation

@Djelibeybi
Copy link
Copy Markdown
Contributor

Proposed change

Switch the LIFX integration to use kelvin for color temperature values.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

Signed-off-by: Avi Miller <me@dje.li>
@homeassistant
Copy link
Copy Markdown
Contributor

Hey there @bdraco, mind taking a look at this pull request as it has been labeled with an integration (lifx) you are listed as a code owner for? Thanks!

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Oct 7, 2022

Nice. That was quick.

I'll give this a spin this weekend

@Djelibeybi
Copy link
Copy Markdown
Contributor Author

I've been wanting this for longer than I've been a contributor to Home Assistant. 😂

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Oct 7, 2022

I tried it on a beam, and I'm not sure if its a problem with the min/max but after I turn it back on/off it jumps back down

Oct-06-2022 15-17-56

@Djelibeybi
Copy link
Copy Markdown
Contributor Author

This may be further weirdness with how the light.turn_on stuff was changed. It seems to bounce the conversion to mireds and back for kelvin, even if kelvin is explicitly stated. I thought it was specific to the LIFX integration because it was the only one that directly called preprocess_turn_on_alternatives but maybe there is a larger problem.

Either way, I have plenty of Beams lying around, so I'll test it now and work it out.

@Djelibeybi
Copy link
Copy Markdown
Contributor Author

I can't reproduce this on my Beams: they remain the same temperature through on/off cycles.

Signed-off-by: Avi Miller <me@dje.li>
@Djelibeybi
Copy link
Copy Markdown
Contributor Author

Djelibeybi commented Oct 7, 2022

I forgot to move the check for color temp changes back to after hue/saturation changes while I was working out an issue with getting the wrong kelvin value. Not sure if it's related to your issue though. And I'm now trying to work out how to extend the UI so that it covers the entire kelvin range available to LIFX devices (1500-9000) instead of being stuck with the more limited 2000-6535 provided now.

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Oct 9, 2022

I dug into this a bit more. In the app the color temp is limited to 2500-9000 but in HA its showing as 1500-9000 so thats why its jumping back.
image

Screen Shot 2022-10-09 at 8 48 11 AM

@Djelibeybi
Copy link
Copy Markdown
Contributor Author

I dug into this a bit more. In the app the color temp is limited to 2500-9000 but in HA its showing as 1500-9000 so thats why its jumping back.

Interesting. There are two Beams on the product list, one that goes to 1500K, the other only to 2500K. I'll double-check to make sure that the aiolifx product list is up-to-date and that we're correctly identifying each Beam.

Copy link
Copy Markdown
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above issue is unrelated to this PR.

So this LGTM 👍

@bdraco bdraco merged commit 41595b0 into home-assistant:dev Oct 9, 2022
@Djelibeybi Djelibeybi deleted the lifx-kelvin branch October 10, 2022 00:54
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 11, 2022
@frenck frenck added the noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) label Oct 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

by-code-owner cla-signed code-quality Hacktoberfest has-tests integration: lifx noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) small-pr PRs with less than 30 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants