Skip to content

Fix GetOverride response schema length mismatch#152

Open
gruijter wants to merge 1 commit into
alistair23:mainfrom
gruijter:fix-getoverride-schema
Open

Fix GetOverride response schema length mismatch#152
gruijter wants to merge 1 commit into
alistair23:mainfrom
gruijter:fix-getoverride-schema

Conversation

@gruijter

@gruijter gruijter commented Jul 7, 2026

Copy link
Copy Markdown

Problem

The current schema for the GetOverride responseType 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 13

Solution

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: uint32 field to the GetOverride responseType schema to match the 13 bytes returned by mowers.

Verification

A unit test test_decode_get_override_response was added to tests/test_response.py to verify that a 13-byte response for GetOverride decodes correctly.

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.
@gruijter

gruijter commented Jul 7, 2026

Copy link
Copy Markdown
Author

Note: this may overlap with #148 — happy to close/rebase once that lands, whichever the maintainer prefers.

@AlirezaT

AlirezaT commented Jul 8, 2026

Copy link
Copy Markdown

I checked this against #148. This specific GetOverride length mismatch should already be covered there.

#148 changes the trailing GetOverride response field to reserved: remaining_uint, so the known 13-byte response parses without forcing a fixed trailing uint32, and it also remains tolerant if mower variants return a different amount of trailing/reserved data.

So if #148 lands first, this PR is probably redundant, though the unit test here is still useful evidence for the 13-byte response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants