fix(z2m): revert raw target decoder to 9-byte stride / int8 id (v3.2.5)#49
Open
nickduvall921 wants to merge 1 commit into
Open
fix(z2m): revert raw target decoder to 9-byte stride / int8 id (v3.2.5)#49nickduvall921 wants to merge 1 commit into
nickduvall921 wants to merge 1 commit into
Conversation
Mirrors upstream herdsman-converters PR #12284 (merged 2026-05-23), which reverted PR #11915. Inovelli's FC32 reportTargetInfo records are 9 bytes (x, y, z, dop as int16 + id as signed int8), not 10 bytes with an int16 id. v3.2.4 had mirrored the now-reverted #11915. - app.py: stride 10 -> 9, byte-need check offset+9 -> offset+8, id parsed via new parse_signed_8 instead of parse_signed_16 - utils.py: add parse_signed_8 helper - tests: +7 parse_signed_8 cases (207 passed) - bump version 3.2.4 -> 3.2.5, CHANGELOG entry Dormant on Z2M >= 2.9 (gated off when parsed mmwave_targets present); fixes coordinates for pre-2.9 raw-fallback users. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Reverts the legacy raw-bytes target decoder back to a 9-byte stride with a signed int8
id, mirroring upstream Z2M PR Koenkk/zigbee-herdsman-converters#12284 (merged 2026-05-23).Background
0xFC32reportTargetInforecords are 9 bytes each:x, y, z, dopas little-endian int16 +idas a signed int8.idas int16 (10-byte stride). Z2M implemented that in #11915 (2026-04-11), and we mirrored it in v3.2.4.idis int8 — and Z2M reverted via #12284.Math.floor(buf.length / 10)was0for 9-byte buffers, so the parsedmmwave_targetsarray was always[]under the broken 10-byte parse.Changes
app.py—_process_target_data: stride10 → 9, byte-need checkoffset+9 → offset+8,idparsed via newparse_signed_8instead ofparse_signed_16.utils.py— addparse_signed_8()helper (matchesparse_signed_16style + fault tolerance).tests/test_parsing.py— +7 cases forparse_signed_8(0, 1, 127, −1, −128, offset read, missing key).config.yaml— version3.2.4 → 3.2.5.CHANGELOG.md—[3.2.5]entry.Impact
mmwave_targetsis present, per 3.2.2), so it only affects pre-2.9 raw-fallback users, who now get correct coordinates again instead of garbage on target License? #2+.mmwave_targetspath benefits directly from #12284: Z2M builds carrying that fix repopulate the array, so modern setups get live targets back.Test plan
pytest tests/→ 207 passed (200 + 7 new)app.pyparses / imports the new helper cleanly🤖 Generated with Claude Code