Skip to content

Commit ccab5f0

Browse files
fix: consumables with time equals 0
1 parent 6c6420f commit ccab5f0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

roborock/containers.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,17 @@ class Consumable(RoborockBase):
380380

381381
def __post_init__(self):
382382
self.main_brush_time_left = (
383-
MAIN_BRUSH_REPLACE_TIME - self.main_brush_work_time if self.main_brush_work_time else None
383+
MAIN_BRUSH_REPLACE_TIME - self.main_brush_work_time if self.main_brush_work_time is not None else None
384384
)
385385
self.side_brush_time_left = (
386-
SIDE_BRUSH_REPLACE_TIME - self.side_brush_work_time if self.side_brush_work_time else None
386+
SIDE_BRUSH_REPLACE_TIME - self.side_brush_work_time if self.side_brush_work_time is not None else None
387+
)
388+
self.filter_time_left = (
389+
FILTER_REPLACE_TIME - self.filter_work_time if self.filter_work_time is not None else None
390+
)
391+
self.sensor_time_left = (
392+
SENSOR_DIRTY_REPLACE_TIME - self.sensor_dirty_time if self.sensor_dirty_time is not None else None
387393
)
388-
self.filter_time_left = FILTER_REPLACE_TIME - self.filter_work_time if self.filter_work_time else None
389-
self.sensor_time_left = SENSOR_DIRTY_REPLACE_TIME - self.sensor_dirty_time if self.sensor_dirty_time else None
390394

391395

392396
@dataclass

0 commit comments

Comments
 (0)