Repository navigation
Conversation
RoborockErrorCode, RoborockDockErrorCode, RoborockInCleaning, RoborockFinishReason, RoborockCleanType and RoborockStartType had no unknown member, so an unrecognized code fell back to the first member: an unmapped robot or dock error read as none/ok and an unmapped in_cleaning value as complete. These enums now decode such codes as unknown, and StatusTrait.resolve_error() without an explicit code skips an unknown error instead of sending -1.
hCoureau
force-pushed
the
submit/fix/unknown-v1-status-codes
branch
from
November 16, 2026 21:24
51113ce to
94cfa63
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
RoborockEnum._missing_decodes a code the library does not know as the enum'sunknownmember when it has one, and as the first member otherwise. The enum conformance test keeps a baseline of enums that still lackunknown.Problem
RoborockErrorCode,RoborockDockErrorCode,RoborockInCleaning,RoborockFinishReason,RoborockCleanTypeandRoborockStartTypehave nounknownmember, so an unrecognized code is reported as a real value. An unrecognized robot or dock error reads asnone/ok,in_cleaning: 4reads ascomplete(#929), and finish reason 78 reads asmanual_interrupt(#523).Changes
unknown = -1to these six enums and remove them from the conformance baseline.StatusTrait.resolve_error()called without a code skips anunknowndock or robot error, so it never sends-1. This keeps the previous behaviour, where such codes decoded asok/noneand nothing was sent.keys()andas_dict()on these enums now includeunknown, so consumers that build option lists from them will see the extra value.Testing
resolve_error(): an unknown dock error falls through to the robot error, and nothing is sent when only an unknown error is reported. They fail without thestatus.pyguard.main.Evidence
roborock.vacuum.a294, firmware 02.40.54), known codes still decode to their names with this change: error 0, dock error 0,in_cleaning3, start type 2, clean types 1, 2 and 3, and finish reasons 43, 54 and 56.resolve_error()skipping it use simulated codes only. My device reports no unmapped code, andresolve_errorwas not sent to it.Related to #929 and #523.