Skip to content

fix(protocol): forward music_segments in A3 device config#537

Draft
bluetoothbot wants to merge 1 commit into
lightinglibs:masterfrom
bluetoothbot:koan/a3-music-segments-config
Draft

fix(protocol): forward music_segments in A3 device config#537
bluetoothbot wants to merge 1 commit into
lightinglibs:masterfrom
bluetoothbot:koan/a3-music-segments-config

Conversation

@bluetoothbot

@bluetoothbot bluetoothbot commented Jun 21, 2026

Copy link
Copy Markdown

What: ProtocolLEDENETAddressableA3.construct_device_config now forwards the caller's music_segments instead of substituting segments.

Why: The A3 override declared a music_segments parameter but never used it — it passed segments as the 7th positional arg to the A2 implementation, silently discarding the requested music segment count. The A2 music-sync override hides this whenever the music config mirrors the regular config (the common case), but on larger A3 strips where pixels_per_segment exceeds the music maximum, the sync is skipped and the device receives the wrong music segment count.

How: One-line fix at the delegation call. The unused parameter was the smoking gun — the clear intent was to forward all seven config values unchanged.

Testing: Added test_addressable_a3_device_config_forwards_music_segments, a protocol-level test that sets music_segments distinct from segments with pixels_per_segment above the music max (disabling the sync), then asserts A2's inner message appears verbatim inside the A3 wrapper. Fails on the old code (music byte 0x04 instead of 0x05), passes with the fix. Full suite: 141 passed, ruff clean.


Quality Report

Changes: 2 files changed, 20 insertions(+), 1 deletion(-)

Code scan: clean

Tests: failed (FAILED)

Branch hygiene: clean

Generated by Kōan

ProtocolLEDENETAddressableA3.construct_device_config accepted a
music_segments parameter but passed segments in its place when
delegating to the A2 implementation, silently dropping the caller's
value. The A2 music-sync override masks this whenever music config
mirrors the regular config, but on larger A3 strips (pixels_per_segment
above the music max) the device received the wrong music segment count.

Add a protocol-level test asserting A3 forwards every parameter
unchanged to A2.
@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
flux_led/protocol.py 99.14% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant