Open
Conversation
43d30a9 to
223fbc5
Compare
223fbc5 to
1ad61a5
Compare
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.
Follow-up to upstream PR Python-roborock#778 / Allen's post-merge style nit.
This keeps the existing B01 behavior but narrows
send_decoded_command()away fromAnyto a concrete response alias:DecodedB01Response = dict[str, object] | strWhy each type exists:
dict[str, object]: used for decoded query-style responses wheredatais structured content, e.g.prop.get,service.get_map_list, and other read/query helpers that parse fields from the returned payload.str: used for raw command ACK responses where the device returns a plain success token like"ok", e.g. action-style commands such as clean/start/pause/stop flows that only need acknowledgement rather than structured data.The point of this follow-up is to make the return shape more explicit for callers/reviewers without over-constraining it to
dictand regressing the existing ACK path.Validation:
./.venv/bin/pytest -q tests/devices/traits/b01/q7/test_init.pyruff check roborock/devices/rpc/b01_q7_channel.py tests/devices/traits/b01/q7/test_init.py