Improve error handling for vacuum clean_area#168177
Merged
arturpragacz merged 4 commits intoApr 28, 2026
Merged
Conversation
Contributor
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
21 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves vacuum.clean_area validation by switching the service implementation to a batched entity-service call so requested areas can be validated across all targeted vacuums, and by introducing a new translated validation error when areas aren’t mapped to any segments on the targeted vacuums.
Changes:
- Add a
batchedmode to entity-service registration/calling so a service handler can receive all matched entities at once. - Update
vacuum.clean_areato run as a batched service handler and raise a newareas_not_mappedvalidation error when appropriate. - Extend vacuum tests and translations to cover the new error path.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/components/vacuum/test_init.py | Updates/extends tests for batched clean_area behavior and new validation error. |
| homeassistant/helpers/service.py | Adds batched entity-service execution path and a helper to call methods across multiple entities. |
| homeassistant/helpers/entity_component.py | Plumbs batched through entity-service registration at the component level. |
| homeassistant/components/vacuum/strings.json | Adds translation for the new areas_not_mapped exception message. |
| homeassistant/components/vacuum/init.py | Implements batched clean_area handler and new cross-vacuum area validation. |
cb6029b to
be9c287
Compare
be9c287 to
ab67ae9
Compare
emontnemery
reviewed
Apr 28, 2026
emontnemery
approved these changes
Apr 28, 2026
Contributor
emontnemery
left a comment
There was a problem hiding this comment.
LGTM, thanks @arturpragacz 👍
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.
Proposed change
Improve error handling for vacuum clean_area.
Improve error handling for
vacuum.clean_areaby utilising batched entity service call, allowing areas to be validated across all targeted vacuums at once and raising an error when areas are not mapped to any segments on the targeted vacuums.Requires #168175.Type of change
Additional information
Checklist
ruff format 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.To help with the load of incoming pull requests: