Repository navigation
Conversation
DefaultConverter, SingleValueConverter, MultiMapsListConverter, LedStatusConverter and DeviceTraitsConverter indexed the first element of a list reply without checking for an empty list, and DeviceTraitsConverter passed a non-dict element to from_dict. These raised IndexError or AttributeError instead of RoborockParsingException. They now raise ValueError, which refresh() wraps as a parsing error, leaving the previous values in place.
hCoureau
force-pushed
the
submit/fix/empty-list-trait-response
branch
from
November 16, 2026 21:24
0003065 to
340034a
Compare
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
V1 traits parse device replies through converters, and
V1TraitMixin.refresh()turns a converter'sValueErrorintoRoborockParsingExceptioncarrying the command and payload. #1034 madeCleanRecordConverterreject empty replies this way.Problem
DefaultConverter,SingleValueConverter,MultiMapsListConverter,LedStatusConverterandDeviceTraitsConvertertake the first element of a list reply without checking that the list is non-empty, andDeviceTraitsConverteralso passes a non-dict first element tofrom_dict. An empty or malformed reply therefore raisesIndexErrororAttributeErrorfromrefresh()instead ofRoborockParsingException.Changes
ValueErrorfor an empty list, andDeviceTraitsConverteralso for a non-dict element.refresh()already wraps that asRoborockParsingException; the trait keeps its previous values.Testing
IndexErrororAttributeErrorwithout the fix.main.Evidence
roborock.vacuum.a294, firmware 02.40.54), normal replies for 14 traits still parse through all five converters with this change.