Fix GetOverride response schema length mismatch#152
Open
gruijter wants to merge 1 commit into
Open
Conversation
The GetOverride responseType schema currently expects a total of 9 bytes
(action: uint8, startTime: tUnixTime, duration: uint32). However, mowers
consistently return 13 bytes for this command, causing a data length mismatch
error ("Data length mismatch. Read 9 bytes of 13") during responses decoding.
By manual decoding, the first 9 bytes contain valid, correct values, leaving
a trailing 4-byte segment. This commit adds an "unknown": "uint32" field to the
GetOverride responseType definition to align the expected length with the
13-byte response actually sent by the mowers.
Author
|
Note: this may overlap with #148 — happy to close/rebase once that lands, whichever the maintainer prefers. |
|
I checked this against #148. This specific #148 changes the trailing So if #148 lands first, this PR is probably redundant, though the unit test here is still useful evidence for the 13-byte response. |
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.
Problem
The current schema for the
GetOverrideresponseType specifies:action:uint8(1 byte)startTime:tUnixTime(4 bytes)duration:uint32(4 bytes)This expects a total payload size of 9 bytes. However, Husqvarna/Gardena mowers consistently return 13 bytes for this command. This leads to a decoding failure with the exception:
ValueError: Data length mismatch. Read 9 bytes of 13Solution
Manual decoding shows that the first 9 bytes contain correct values (action, startTime, and duration are decoded perfectly), leaving a trailing 4-byte chunk. This PR adds an
unknown: uint32field to theGetOverrideresponseType schema to match the 13 bytes returned by mowers.Verification
A unit test
test_decode_get_override_responsewas added totests/test_response.pyto verify that a 13-byte response forGetOverridedecodes correctly.