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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip unsupported LIFX Switches during discovery #67726

Merged
merged 3 commits into from Mar 17, 2022

Conversation

Djelibeybi
Copy link
Contributor

This resolves an issue with the underlying library waiting for
a response from the switches that will never arrive.

Signed-off-by: Avi Miller me@dje.li

Proposed change

This change adjusts the discovery of LIFX devices so that switches are skipped. This is due to the underlying aiolifx library's lack of support for switches and the core integration's assumption that all LIFX devices are bulbs. The bulb.get_color call will hang for about 2-3 minutes for each switch discovered without this fix.

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)
  • 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:

This resolves an issue with the underlying library waiting for
a response from the switches that will never arrive.

Signed-off-by: Avi Miller <me@dje.li>
Djelibeybi and others added 2 commits March 6, 2022 18:06
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
@frenck frenck requested a review from bdraco March 7, 2022 11:22
@frenck frenck added the smash Indicator this PR is close to finish for merging or closing label Mar 7, 2022
@@ -74,6 +74,7 @@
UNAVAILABLE_GRACE = 90

FIX_MAC_FW = AwesomeVersion("3.70")
SWITCH_PRODUCT_IDS = [70, 71, 89]
Copy link
Member

Choose a reason for hiding this comment

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

It would be cleaner if the library provided this in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be even better if the library supported the Switch.

Dev automation moved this from Needs review to Reviewer approved Mar 7, 2022
@mekenthompson

This comment was marked as off-topic.

@frenck

This comment was marked as off-topic.

@mekenthompson

This comment was marked as off-topic.

@frenck
Copy link
Member

frenck commented Mar 15, 2022

Chill, I'm merely asking on an ETA.

There is no ETA. Please just be patient. Thanks 馃憤

Let's keep comments on PR towards the actual review as well. If you have further/other questions, please use our community forum or Discord chat.

../Frenck

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @Djelibeybi 馃憤

@frenck frenck merged commit 9ea73e0 into home-assistant:dev Mar 17, 2022
Dev automation moved this from Reviewer approved to Done Mar 17, 2022
@Djelibeybi
Copy link
Contributor Author

You're welcome @frenck.

If I may: the LIFX integration is showing its age and needs more than a little bit of love. Where's the right place to discuss what's required and how best to implement those requirements? In particular, I'd be keen to replace the underlying library used, and I'd love to get feedback from others.

@Djelibeybi Djelibeybi deleted the skip-lifx-switches branch March 17, 2022 18:23
@frenck
Copy link
Member

frenck commented Mar 17, 2022

@Djelibeybi Well, you can show it some love by opening PRs of course :)

For the library, I think it is always best (for the whole Python ecosystem) to discuss library changes with the current maintainer of the library.

If you have further questions in general, please feel free to join our Discord chat.

../Frenck

@Djelibeybi
Copy link
Contributor Author

Great, thanks.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix cla-signed integration: lifx small-pr PRs with less than 30 lines. smash Indicator this PR is close to finish for merging or closing
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

Issue with Lifx integration
5 participants