Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions roborock/devices/traits/v1/consumeable.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class ConsumableAttribute(StrEnum):
FILTER_WORK_TIME = "filter_work_time"
SIDE_BRUSH_WORK_TIME = "side_brush_work_time"
MAIN_BRUSH_WORK_TIME = "main_brush_work_time"
STRAINER_WORK_TIME = "strainer_work_time"
CLEANING_BRUSH_WORK_TIME = "cleaning_brush_work_time"
STRAINER_WORK_TIME = "strainer_work_times"
CLEANING_BRUSH_WORK_TIME = "cleaning_brush_work_times"

@classmethod
def from_str(cls, value: str) -> Self:
Expand Down
4 changes: 2 additions & 2 deletions tests/devices/traits/v1/test_consumable.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ async def test_get_consumable_data_success(consumable_trait: ConsumableTrait, mo
(ConsumableAttribute.SIDE_BRUSH_WORK_TIME, "side_brush_work_time"),
(ConsumableAttribute.FILTER_WORK_TIME, "filter_work_time"),
(ConsumableAttribute.SENSOR_DIRTY_TIME, "sensor_dirty_time"),
(ConsumableAttribute.STRAINER_WORK_TIME, "strainer_work_time"),
(ConsumableAttribute.CLEANING_BRUSH_WORK_TIME, "cleaning_brush_work_time"),
(ConsumableAttribute.STRAINER_WORK_TIME, "strainer_work_times"),
(ConsumableAttribute.CLEANING_BRUSH_WORK_TIME, "cleaning_brush_work_times"),
],
)
async def test_reset_consumable_data(
Expand Down
12 changes: 12 additions & 0 deletions tests/testing/test_v1_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ async def test_trait_consumable_reset():

await device.v1_properties.consumables.refresh()
assert device.v1_properties.consumables.filter_work_time == 74384
assert device.v1_properties.consumables.strainer_work_times == 65
assert device.v1_properties.consumables.cleaning_brush_work_times == 66

# Reset the filter consumable through the trait API
await device.v1_properties.consumables.reset_consumable(ConsumableAttribute.FILTER_WORK_TIME)
Expand All @@ -62,6 +64,16 @@ async def test_trait_consumable_reset():
# The trait auto-refreshes after reset, so the client should reflect the change
assert device.v1_properties.consumables.filter_work_time == 0

# Reset the strainer consumable through the trait API
await device.v1_properties.consumables.reset_consumable(ConsumableAttribute.STRAINER_WORK_TIME)
assert fake_device.consumables.strainer_work_times == 0
assert device.v1_properties.consumables.strainer_work_times == 0

# Reset the cleaning brush consumable through the trait API
await device.v1_properties.consumables.reset_consumable(ConsumableAttribute.CLEANING_BRUSH_WORK_TIME)
assert fake_device.consumables.cleaning_brush_work_times == 0
assert device.v1_properties.consumables.cleaning_brush_work_times == 0


async def test_trait_dnd_refresh():
"""Verify that the DND timer trait can be refreshed from the simulator."""
Expand Down
Loading