Skip to content

Conversation

@epenet
Copy link
Contributor

@epenet epenet commented Apr 20, 2023

Proposed change

Linked to #91360
Based on feedback from @frenck in #91744

Replaces:

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

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
  • I have followed the perfect PR recommendations
  • 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:

@epenet epenet requested a review from a team as a code owner April 20, 2023 13:22
@home-assistant home-assistant bot added bugfix cla-signed core small-pr PRs with less than 30 lines. labels Apr 20, 2023
@epenet epenet mentioned this pull request Apr 20, 2023
20 tasks
Comment on lines +117 to +118
if self.config_entry:
self.config_entry.async_on_unload(self.async_shutdown)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should it shutdown on all coordinators that have a config entry?
Or should we add a specific argument?

Suggested change
if self.config_entry:
self.config_entry.async_on_unload(self.async_shutdown)
if shutdown_on_entry_unload:
assert self.config_entry
self.config_entry.async_on_unload(self.async_shutdown)

Copy link
Member

Choose a reason for hiding this comment

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

I’m struggling to think of a case where you wouldn’t want to shutdown on unload. I think it would be a bug to not.

@epenet epenet marked this pull request as draft April 20, 2023 14:30
@epenet
Copy link
Contributor Author

epenet commented Apr 20, 2023

CI failure is due to wallbox tests leaking into one-another (fixed in #91752)

@epenet epenet marked this pull request as ready for review April 20, 2023 19:44
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.

That is not exactly what I meant with my comment (my comment was intended to move the shutdown internally inside the WLED to a different location).

But nevertheless, this solution works as well and improves the "just works" experience.

Thanks, @epenet 👍

../Frenck

@frenck frenck merged commit 79ad9a3 into home-assistant:dev Apr 21, 2023
@epenet epenet deleted the auto-shutdown-coordinator branch April 21, 2023 08:09
@epenet epenet mentioned this pull request Apr 21, 2023
89 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Apr 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugfix cla-signed core small-pr PRs with less than 30 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants