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.
Description:
When calling a service, before async came around, we would first call turn_on on each light, after that we would go through each light and call update.
During our migration to async we initially would fire off update tasks as soon as possible while calling turn_on and just wait at the end of the service till all tasks were done. We realized quickly that this was hitting devices too hard and decided to wait till the update was done. We didn't realize by doing so we were now doing: call turn on 1, update 1, call turn on 2, update 2, etc.
This PR fixes it.
Related issue (if applicable): fixes #4783
If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass