Skip to content

Fix lifx.set_state so it works with kelvin and color_temp_kelvin and color names#81515

Merged
bdraco merged 3 commits into
home-assistant:devfrom
Djelibeybi:fix-lifx-set-state
Nov 5, 2022
Merged

Fix lifx.set_state so it works with kelvin and color_temp_kelvin and color names#81515
bdraco merged 3 commits into
home-assistant:devfrom
Djelibeybi:fix-lifx-set-state

Conversation

@Djelibeybi
Copy link
Copy Markdown
Contributor

@Djelibeybi Djelibeybi commented Nov 3, 2022

Proposed change

After the change to kelvin as default color temp unit, the lifx.set_state stopped accepting kelvin as a parameter. We also stopped processing color names when we dropped the call to preprocess_turn_on_alternatives which is now restored as well. I added a bunch of tests for lifx.set_state too.

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.

To help with the load of incoming pull requests:

… parameters

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

home-assistant Bot commented Nov 3, 2022

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!

Code owner commands

Code owners of lifx can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign lifx Removes the current integration label and assignees on the issue, add the integration domain after the command.

@bdraco bdraco added this to the 2022.11.2 milestone Nov 3, 2022
@tggman
Copy link
Copy Markdown

tggman commented Nov 4, 2022

Not sure if this is related, but ever since the HAC 2022.11.0 and the latest LIFX latest firmware updates (which happened on the same day) I cannot get lifx.set_state to set the brightness and/or colors. There is nothing in the logs to indicate any problem.

Will this fix also fix these issues or should I open another bug report?

@Djelibeybi
Copy link
Copy Markdown
Contributor Author

This should fix that too. It's working for me with the new firmware. If it doesn't, open a new bug after this fix is released.

@Djelibeybi Djelibeybi changed the title Fix lifx.set_state so it works with kelvin and color_temp_kelvin Fix lifx.set_state so it works with kelvin and color_temp_kelvin and color names Nov 5, 2022
Comment thread homeassistant/components/lifx/util.py Outdated
Comment thread homeassistant/components/lifx/util.py
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.

Please see the comments for the new commit

Including a couple of new tests.

Signed-off-by: Avi Miller <me@dje.li>
@bdraco bdraco merged commit f66009c into home-assistant:dev Nov 5, 2022
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Nov 5, 2022

Thanks @Djelibeybi

@julio8a
Copy link
Copy Markdown

julio8a commented Nov 5, 2022

Thank you @Djelibeybi! :)

@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2022
@Djelibeybi Djelibeybi deleted the fix-lifx-set-state branch November 6, 2022 23:08
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.

LIFx behavior since upgrading to 2022.11 LIFX Integration has changed key for kelvin color temperature

5 participants