Change area param of CleanArea to list of int or float#1449
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request improves the API design of CleanArea commands by changing the area parameter type from a string to a more type-safe list[int | float]. The change makes the API more intuitive and easier to use, as callers no longer need to manually format coordinates as comma-separated strings.
Changes:
- Changed parameter type from
strtolist[int | float]for allCleanAreacommand variants (XML, JSON, and V2) - Updated internal implementation to convert the list to comma-separated strings using
",".join(str(i) for i in area) - Updated all test cases to use the new list-based API
- Updated type signature in
CapabilityCleanActionto reflect the API change
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| deebot_client/commands/xml/clean.py | Updated CleanArea.__init__ to accept list[int | float] and convert to comma-separated string |
| deebot_client/commands/json/clean.py | Updated CleanArea and CleanAreaV2.__init__ to accept list[int | float] and convert to comma-separated string |
| deebot_client/capabilities.py | Updated CapabilityCleanAction.area type signature to match new API |
| tests/commands/xml/test_clean.py | Updated test instantiations to use lists instead of strings |
| tests/commands/json/test_clean.py | Updated test instantiations to use lists instead of strings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1449 +/- ##
=======================================
Coverage 94.79% 94.79%
=======================================
Files 152 152
Lines 5974 5974
Branches 350 350
=======================================
Hits 5663 5663
Misses 249 249
Partials 62 62 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.