Accept the optional timer byte in 0x1946 - #22
Open
smoke0leg wants to merge 1 commit into
Open
Conversation
0x1946 (Control Floor Heating Status) is encoded as a fixed 7-byte payload. Some DLP thermostats reject that length and require an 8th byte — the timer — which is the same field 0x1945 already handles as optional. Measured on a live bus against three 0x23AB thermostats: with a 7-byte payload the device answers 0x1947 with F5 (failure); appending the timer byte makes the same command succeed with F8. Only the length differs between the two cases. parse now reads timer when the payload is at least 8 bytes and encode appends it only when data.timer is set, so payloads without a timer are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013snkkHrKRD5LX9e4xjDWez
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.
What
0x1946(Control Floor Heating Status) is encoded as a fixed 7-byte payload.Some DLP thermostats reject that length and require an 8th byte — the timer —
which is the same field
0x1945already handles as optional.This makes
0x1946symmetric with0x1945:parsereadstimerwhen thepayload is at least 8 bytes,
encodeappends it only whendata.timeris set.Payloads without a timer are byte-for-byte unchanged, so the change is
backwards compatible.
How it was found
Measured on a live Buspro installation (9 devices on subnet 1, three
0x23ABDLP floor-heating thermostats). Controlling the floor heating failed
consistently until the payload length was changed:
0x1947responseF5— failureF8— successSame device, same field values; only the length differs. HDL's own
documentation is not public, so this is behaviour observed on the wire, not a
spec citation.
Tests
Added a second fixture for
0x1946— one example with the timer and onewithout — mirroring the pair that already exists for
0x1945.The test was checked against the bug it claims to catch: with the new fixture
in place but
lib/commands.jsreverted, the suite fails withWith the fix applied: 207 passing.
npx eslint lib testreports the same 13 problems before and after this change(all pre-existing and in unrelated lines), so I left them alone to keep the
diff focused.
Not included
0x1947, the control response, may carry the same optional byte. I have nocapture proving it, so I did not touch it.
🤖 Generated with Claude Code