-
-
Notifications
You must be signed in to change notification settings - Fork 150
Add DEEBOT OZMO T8 AIVI+ (w16crm) #658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is the same as x5d34r (`DEEBOT OZMO T8 AIVI`)
WalkthroughThis pull request introduces a new file, Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (4)
deebot_client/hardware/deebot/w16crm.py (2)
Line range hint
4-81: Consider refactoring shared capabilities to reduce code duplicationThe capabilities defined for
w16crmappear to be identical or very similar to those inx5d34r.py. To improve maintainability and reduce code duplication, consider refactoring the common capabilities into a shared base class or a helper function that both device modules can utilize.
Line range hint
4-81: Add module-level docstring for better code documentationIt's a good practice to include a module-level docstring at the beginning of the file to describe the purpose and functionality of the module. This aids in code readability and maintainability.
Apply the following diff to add a docstring:
+ """Module for the w16crm (DEEBOT OZMO T8 AIVI+) device capabilities."""tests/hardware/test_init.py (2)
Line range hint
65-130: Add test case for the new devicew16crmThe test function
test_capabilities_event_extractioncurrently does not include a test case for the newly added devicew16crm. To ensure that the capabilities ofw16crmare correctly tested, please add a corresponding test case.Apply the following diff to include the test case:
@pytest.mark.parametrize( ("class_", "expected"), [ ( "5xu9h3", { AdvancedModeEvent: [GetAdvancedMode()], # ... existing test cases ... }, ), # ... other test cases ... + ( + "w16crm", + { + AdvancedModeEvent: [GetAdvancedMode()], + AvailabilityEvent: [GetBattery(is_available_check=True)], + BatteryEvent: [GetBattery()], + CachedMapInfoEvent: [GetCachedMapInfo()], + CarpetAutoFanBoostEvent: [GetCarpetAutoFanBoost()], + CleanCountEvent: [GetCleanCount()], + CleanPreferenceEvent: [GetCleanPreference()], + ContinuousCleaningEvent: [GetContinuousCleaning()], + CustomCommandEvent: [], + ErrorEvent: [GetError()], + FanSpeedEvent: [GetFanSpeed()], + LifeSpanEvent: [ + GetLifeSpan( + [ + LifeSpan.BRUSH, + LifeSpan.FILTER, + LifeSpan.SIDE_BRUSH, + LifeSpan.UNIT_CARE, + ] + ) + ], + MajorMapEvent: [GetMajorMap()], + MapChangedEvent: [], + MapTraceEvent: [GetMapTrace()], + MultimapStateEvent: [GetMultimapState()], + NetworkInfoEvent: [GetNetInfo()], + PositionsEvent: [GetPos()], + ReportStatsEvent: [], + RoomsEvent: [GetCachedMapInfo()], + StateEvent: [GetChargeState(), GetCleanInfo()], + StatsEvent: [GetStats()], + TotalStatsEvent: [GetTotalStats()], + TrueDetectEvent: [GetTrueDetect()], + VolumeEvent: [GetVolume()], + WaterInfoEvent: [GetWaterInfo()], + }, + ), ], - ids=["5xu9h3", "itk04l", "yna5xi", "p95mgv"], + ids=["5xu9h3", "itk04l", "yna5xi", "p95mgv", "w16crm"], ) async def test_capabilities_event_extraction( class_: str, expected: dict[type[Event], list[Command]] ) -> None: # ... existing test function code ...
287-287: Ensure the device list remains sorted for consistencyIn the
test_all_models_loadedfunction, the devices are listed in a specific order. With the addition of"w16crm", consider keeping the list sorted alphabetically to maintain consistency and ease future maintenance.Apply the following diff to sort the device list:
_load() assert list(DEVICES) == [ "1vxt52", # ... existing devices ... "vi829v", - "w16crm", "x5d34r", + "w16crm", "yna5xi", # ... remaining devices ... ]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
deebot_client/hardware/deebot/w16crm.py(1 hunks)tests/hardware/test_init.py(1 hunks)
🔇 Additional comments (1)
deebot_client/hardware/deebot/w16crm.py (1)
1-1:
Remove invalid code at the beginning of the file
Line 1 contains x5d34r.py, which is not valid Python code and will cause a syntax error. It appears to be a leftover from copying or referencing another file. Please remove this line to fix the syntax error.
Apply the following diff to fix the issue:
- x5d34r.pyLikely invalid or redundant comment.
DEEBOT OZMO T8 AIVI+)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #658 +/- ##
=======================================
Coverage 86.68% 86.68%
=======================================
Files 90 90
Lines 3365 3365
Branches 298 298
=======================================
Hits 2917 2917
Misses 394 394
Partials 54 54 ☔ View full report in Codecov by Sentry. |
edenhaus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @brettjurgens 👍
This is the same as x5d34r (
DEEBOT OZMO T8 AIVI)Summary by CodeRabbit
New Features
Bug Fixes