-
-
Notifications
You must be signed in to change notification settings - Fork 36.4k
Shutdown coordinator on entry unload #91748
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| if self.config_entry: | ||
| self.config_entry.async_on_unload(self.async_shutdown) |
There was a problem hiding this comment.
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?
| 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) |
There was a problem hiding this comment.
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.
|
|
frenck
left a comment
There was a problem hiding this 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
Proposed change
Linked to #91360
Based on feedback from @frenck in #91744
Replaces:
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: