Repository navigation
Conversation
Combining a multi-phase clean record assigned to the read-only begin_datetime property. The error was swallowed, so callers got the last phase's duration, area and counters and its start type. Build the record from the last phase with the first phase's begin and start type, and sum duration, area and counters across phases; fields no phase reports stay unset. Replies mixing record formats now raise a parsing error.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
get_clean_recordcan return a list with one record per phase of a clean, for example vacuum then mop.CleanRecordConverteris meant to combine the phases into oneCleanRecord. #1034 noted multi-phase aggregation as a separate existing issue; this addresses it.Problem
The converter combined the phases by assigning to
CleanRecord.begin_datetime, which is a read-only property. The resultingAttributeErrorwas swallowed by a broadexcept, so callers got the last phase's duration, area, counters andstart_typeinstead of totals for the whole clean.Changes
dataclasses.replaceon the last phase. It keeps the first phase'sbeginandstart_typeand sumsduration,area,avoid_countandwash_countacross phases, which is what the existing code was trying to do.Noneand is not filled in as 0.except Exception. A reply that mixes structured and list-form phases now raisesRoborockParsingException.Testing
main.Evidence
roborock.vacuum.a294, firmware 02.40.54), 20 single-phase records read through this branch parse to the same duration, area, begin and end as the raw replies, so the single-phase path is unchanged on hardware.