Repository navigation
Fix CB120B detection: map NW-20230112 to the CB120B profile (type 70) - #115
Merged
Merged
Conversation
The CB120B advertises as NW-20230112&<serial>. getProjectName had no case for 20230112, so the light resolved to an empty project name and fell through to light type 0, which has no database profile. It then received legacy 0x82/0x83 CCT packets (clamped to 3200-5600K) that the light ignores, so only power on/off worked. Database/lights.json has carried a CB120B profile as type 70 since keefo#90, but the CB120B branch in getLightType pointed at type 84, which has no profile. - getProjectName: add 20230112 -> CB120B - getLightType: route CB120B to type 70 (the database profile) - getProjectName(idx): return CB120B for 70 - add a unit test for the NW-20230112 name Verified on hardware: type 70's CCT packet (78 87 05 brr cct 32 00 00 chk) drives a CB120B correctly across 2700-6500K and 0-100%.
keefo
previously approved these changes
Sep 5, 2026
Owner
|
thank you for providing this pr. |
Owner
|
@copilot resolve the merge conflicts in this pull request |
# Conflicts: # NeewerLite/NeewerLite/Model/NeewerLightConstant.swift
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.
Problem
The CB120B advertises over BLE as
NW-20230112&<serial>.getProjectName(_:)has no case for20230112, so the light resolves to an empty project name,getLightTypefalls through to type 0, and the app sends it the legacy0x82/0x83CCT packets (clamped to 3200–5600K), which the light ignores. Result: the light appears, power on/off works, but the CCT and brightness sliders do nothing.Database/lights.jsonhas carried a CB120B profile as type 70 since #90, but nothing routed to it: the existingnickName.contains("CB120B")branch returns 84, which has no database profile.Fix
getProjectName(_:): add"20230112" → "CB120B"getLightType: route CB120B to type 70 (the database profile) instead of 84getProjectName(_ idx:): return"CB120B"for 70NW-20230112&…nameVerification
Tested on a real CB120B (macOS, this branch built as Release):
CB120B, imagecb120b.png, CCT range 27–65.set_cctworks; the packet sent is the type-70 pattern78 87 05 <brr> <cct> 32 00 00 <chk>, which I also confirmed directly over BLE outside the app.No database change needed.