Add washing as valid state to cleanInfo#1014
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR extends the valid states for cleaning by adding washing as an acceptable value in the cleanInfo command.
- Updates test cases to pass the command class instead of an instance and add a new test case for the washing state.
- Modifies the clean command logic to treat "washing" as equivalent to "clean" in state processing.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/commands/json/test_clean.py | Updates test parameter from an instance to a class and adds a washing state test case. |
| deebot_client/commands/json/clean.py | Adjusts state mapping to include "washing" alongside "clean" and processes associated data. |
Comments suppressed due to low confidence (2)
tests/commands/json/test_clean.py:62
- [nitpick] Consider renaming the 'command' parameter to 'command_class' to clearly indicate that a class type is being passed instead of an instance.
async def test_GetCleanInfo(command: type[GetCleanInfo], data: tuple[dict[str, Any], FirmwareEvent], expected: StateEvent) -> None:
deebot_client/commands/json/clean.py:124
- Consider adding an inline comment to document that the 'washing' state is intentionally processed in the same manner as 'clean' for clarity on state mapping.
elif state in ("clean", "washing"):
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## dev #1014 +/- ##
==========================================
+ Coverage 93.65% 93.77% +0.11%
==========================================
Files 129 129
Lines 5012 5012
Branches 327 327
==========================================
+ Hits 4694 4700 +6
+ Misses 258 249 -9
- Partials 60 63 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #1014 will not alter performanceComparing Summary
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes home-assistant/core#145338