Skip to content

Commit 2b0e9a0

Browse files
committed
chore: address review feedback for dock_state
1 parent a40c404 commit 2b0e9a0

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

roborock/data/v1/v1_containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def dock_state(self) -> RoborockDockState:
429429
newer off-peak charging logic seamlessly while maintaining backwards compatibility
430430
with older devices.
431431
"""
432-
if self.state is None:
432+
if self.state is None or self.state == RoborockStateCode.unknown:
433433
return RoborockDockState.unknown
434434

435435
# 6. DUSTING

tests/data/v1/test_v1_containers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,14 @@ def test_current_map() -> None:
149149
(RoborockStateCode.emptying_the_bin, None, 50, RoborockDockState.dusting),
150150
(RoborockStateCode.charging_complete, None, 100, RoborockDockState.full),
151151
(RoborockStateCode.charging, None, 100, RoborockDockState.full),
152-
(RoborockStateCode.charging, RoborockChargeStatus.charging, 90, RoborockDockState.charging),
153-
(RoborockStateCode.charging, RoborockChargeStatus.charge_waiting, 50, RoborockDockState.off_peak_waiting),
152+
(RoborockStateCode.charging, RoborockChargeStatus.charging.value, 90, RoborockDockState.charging),
153+
(RoborockStateCode.charging, RoborockChargeStatus.charge_waiting.value, 50, RoborockDockState.off_peak_waiting),
154154
(RoborockStateCode.charging, None, 50, RoborockDockState.charging),
155155
(RoborockStateCode.returning_home, None, 20, RoborockDockState.returning),
156156
(RoborockStateCode.docking, None, 15, RoborockDockState.returning),
157157
(RoborockStateCode.cleaning, None, 80, RoborockDockState.idle),
158158
(RoborockStateCode.paused, None, 80, RoborockDockState.idle),
159+
(RoborockStateCode.unknown, None, 100, RoborockDockState.unknown),
159160
(None, None, 100, RoborockDockState.unknown),
160161
],
161162
)

0 commit comments

Comments
 (0)