-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Add support for Deebot N8 Pro+ #617
Conversation
WalkthroughThe changes introduce 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 (1)
tests/hardware/test_init.py (1)
Line range hint
77-126
: Add test case for the new device"ifbw08"
in the parameterized testsTo ensure thorough testing of the new device's capabilities, please add a test case for
"ifbw08"
in thetest_capabilities_event_extraction
function.Apply this diff to include the new test case:
ids=["5xu9h3", "itk04l", "yna5xi", "p95mgv"], ) async def test_capabilities_event_extraction( class_: str, expected: dict[type[Event], list[Command]] ) -> None: info = await get_static_device_info(class_) assert info is not None capabilities = info.capabilities assert capabilities._events.keys() == expected.keys() for event, expected_commands in expected.items(): assert ( capabilities.get_refresh_commands(event) == expected_commands ), f"Refresh commands doesn't match for {event}" +@pytest.mark.parametrize( + ("class_", "expected"), + [ + ( + "ifbw08", + { + 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=["ifbw08"], +) +async def test_capabilities_event_extraction_ifbw08( + class_: str, expected: dict[type[Event], list[Command]] +) -> None: + info = await get_static_device_info(class_) + assert info is not None + capabilities = info.capabilities + assert capabilities._events.keys() == expected.keys() + for event, expected_commands in expected.items(): + assert ( + capabilities.get_refresh_commands(event) == expected_commands + ), f"Refresh commands doesn't match for {event}" +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
deebot_client/hardware/deebot/ifbw08.py
(1 hunks)tests/hardware/test_init.py
(1 hunks)
🔇 Additional comments (2)
deebot_client/hardware/deebot/ifbw08.py (1)
1-1
:
Incorrect module name at the top of the file
The file is named ifbw08.py
, but the first line contains x5d34r.py
. This appears to be a copy-paste error. Please update the module name to reflect the correct filename.
Apply this diff to correct the module name:
-x5d34r.py
+ifbw08.py
Likely invalid or redundant comment.
tests/hardware/test_init.py (1)
266-266
: LGTM!
The addition of "ifbw08"
to the devices list in the test_all_models_loaded
function ensures that the new device is included in the model loading tests.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #617 +/- ##
=======================================
Coverage 86.42% 86.42%
=======================================
Files 88 88
Lines 3301 3301
Branches 298 298
=======================================
Hits 2853 2853
Misses 394 394
Partials 54 54 ☔ View full report in Codecov by Sentry. |
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 @Kokahontas13 👍
Summary by CodeRabbit
New Features
Bug Fixes