feat: 0xB6 E1 22 color/segment set + solid-color reporting#544
Open
asxzy wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
b12c417 to
f1edd81
Compare
Add the E1 22 uniform-fill path for solid colors on the 0xB6 (Surplife) extended-custom protocol and custom per-segment colors: - protocol: construct_levels_change rewritten as a uniform E1 22 fill so a plain color lands in preset 0x24 (Colorful, effect=None); single white is combined by max (not sum) to avoid double-counting the mirrored channel; add _rgb_to_hsv_bytes / _rgb_to_hsv_bytes_rgbw and construct_custom_segment_colors. - base_device: _named_effect reports preset 0x24 as a plain color (no effect); add _generate_custom_segment_colors with validation. - device/aiodevice: add setCustomSegmentColors / async_set_custom_segment_colors. - tests: sync + aio coverage for the above.
Contributor
Author
|
@bdraco This one is ready for review. It adds one single command only |
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
First of a stacked series splitting the large 0xB6 effects work (#540) into reviewable PRs. This PR adds only the E1 22 color/segment path and solid-color reporting for the 0xB6 (Surplife) extended-custom protocol. The extended custom effects (E1 21) and scribble (E1 23/E1 26) features land in follow-up PRs stacked on top of this one.
What's included
construct_levels_changerewritten as a uniform E1 22 fill so a plain color lands the device in preset0x24("Colorful",effect=None) rather than an E1 21 Static Fill scene (hardware-verified).max(not sum) to avoid double-counting the mirrored warm/cool channel on this single-white-LED device._rgb_to_hsv_bytes/_rgb_to_hsv_bytes_rgbwhelpers andconstruct_custom_segment_colors._named_effectreports preset0x24as a plain color (no effect)._generate_custom_segment_colorswith validation.setCustomSegmentColors/async_set_custom_segment_colors.const.pyandpattern.pyare untouched.Verification
All gates pass locally:
pytest -q— 169 passedruff check flux_led/ tests/— cleanruff format --check flux_led/ tests/— cleanmypy --python-version=3.13 flux_led/*.py— cleanmypy --python-version=3.10 flux_led/*.py— cleanStack
This is PR 1 of 3 (colors -> extended effects -> scribble).