Refactor ESPHome camera to avoid creating tasks#95818
Merged
Merged
Conversation
Contributor
|
Hey there @OttoWinter, @jesserockz, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Member
Author
|
oops, meant to open as draft |
bdraco
commented
Jul 4, 2023
bdraco
commented
Jul 4, 2023
20 tasks
Member
Author
|
I guess we can drop the timeout since on disconnect the futures all resolve now |
frenck
approved these changes
Jul 8, 2023
Member
Author
|
Thanks. this one is going to make a big difference if someone has a few cameras |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
needs #95822 which has test coverage for thisProposed change
Refactor ESPHome camera to avoid creating tasks
If the ESPHome device disconnects, all the futures are resolved right away to avoid waiting forever if the esp disconnected or crashed.
This makes the camera more responsive in HA. It's still a bit slow, but there is room for future improvements on the esphome side
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: