diff --git a/roborock/devices/traits/v1/consumeable.py b/roborock/devices/traits/v1/consumeable.py index da0c4c07..70d0a742 100644 --- a/roborock/devices/traits/v1/consumeable.py +++ b/roborock/devices/traits/v1/consumeable.py @@ -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: diff --git a/tests/devices/traits/v1/test_consumable.py b/tests/devices/traits/v1/test_consumable.py index 5c995c44..221c6403 100644 --- a/tests/devices/traits/v1/test_consumable.py +++ b/tests/devices/traits/v1/test_consumable.py @@ -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( diff --git a/tests/testing/test_v1_simulator.py b/tests/testing/test_v1_simulator.py index f11fd42d..8883047c 100644 --- a/tests/testing/test_v1_simulator.py +++ b/tests/testing/test_v1_simulator.py @@ -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) @@ -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."""