Skip to content

V1 CleanSummaryTrait selects oldest cleaning when record IDs are ascending (Qrevo Edge 2 Flow) #976

Closed

Description

@vize69

Environment and observed behavior

Roborock Qrevo Edge 2 Flow (roborock.vacuum.a328), Home Assistant Core 2026.10.0b1, then 2026.10.0b3; both pin python-roborock 7.12.0.

The native diagnostic contains nine numeric cleaning-record IDs in ascending order. The first corresponds to the first cleaning on the previous day; the last corresponds to a newer cleaning. Home Assistant's live cleaning area/duration update, but the last-clean-start/end entities keep displaying the oldest run.

In roborock/devices/traits/v1/clean_summary.py, CleanSummaryTrait.refresh() uses self.records[0]. The same selection was present in upstream main when inspected on 2026-10-07.

Minimal reproduction

Synthetic timestamp IDs preserving the observed ordering:

records = [1700000000, 1700000100, 1700000200]
assert records[0] != max(records)

Our local offline reproducer executes the actual refresh-method body with mocked parent refresh and record RPC, verifying which ID is requested. It covers ascending, descending, mixed, singleton, empty and absent record lists, including clearing stale last-record data.

Proposed narrow fix

-        last_record_id = self.records[0]
+        last_record_id = max(self.records)

This assumes V1 record IDs are start timestamps. That matches this device's records and the V1 protocol examples. Please confirm this contract for other V1 models. It does not change list order, synthesize an end time, or fetch every record. The existing empty-list guard remains.

Hardware validation and limits

A local patch fetched the actual newer record and restored the native HA start/end values; their interval matched the reported duration. After a Core update the stale values returned. The new container's library files were not directly inspected, so replacement is inferred from the upgrade and regression, not claimed as a measured file hash.

Our local exact-source offline suite passes 36 checks for this history change and separately documented mode fixes. This is not a full upstream pytest/CI run. No device commands were sent by the tests. No credentials, network addresses, floor maps or real household cleaning timestamps are included in this report.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions