Repository navigation
fix: white mode instead of colour temperature for single-white unified lamps - #122
Merged
Merged
Conversation
…d lamps (#121) Product 39 (Sunset Lamp) has one fixed warm-white channel, and the code already forced temp 0% for it, so 2700K and 6500K sent identical bytes while the light still offered a colour temperature range. Products with uses_color_v2, a warm-white channel and no cool-white channel now offer ColorMode.WHITE (brightness only) instead of COLOR_TEMP. The white command is the 0x3B 0xB1 frame the lamp already acknowledges as white mode, and state frames and adverts track it. Co-Authored-By: Claude Sonnet 5.5 <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.
Refs #121 (colour temperature part only; the effect speed read-back is still waiting on a log).
The Sunset Lamp (product 39,
Ctrl_Mini_RGBW) has one fixed warm-white channel.set_color_tempalready forcedtemp_pct = 0for it, so 2700K and 6500K sent identical bytes, but the light still offered a 2700 to 6500K range.Changes:
device.py: newhas_fixed_white(uses_color_v2, warm-white channel, no cool-white channel).has_color_tempreturns False for these.set_white()also handles them, sending the 0x3B 0xB1 frame (temp 0%) that the lamp already acknowledges as white mode (0x31 on BLE older than v5). State frames and adverts setwhite_modeand no longer set a kelvin value.light.py: these lamps offerColorMode.WHITEinstead ofCOLOR_TEMP.white:and brightness changes in white mode reuse the iotbt: white mode for product 170 (#114) #117 code.Other devices: only product 39 sets
uses_color_v2with a warm-white-only channel. Products 4, 6, 32, 38 and 72 are warm-white-only but unchanged (tested). Product 39 users lose the colour temperature slider and gain a white mode; the lamp output is the same.Tests: new
tests/test_fixed_white.pyuses the frames from the debug log in #75, including the exact white command. Suite: 45 passed.Not verified on hardware. No version bump in this PR.
🤖 Generated with Claude Code