Repository navigation
Conversation
|
Profile category check: ✅ Passed - all profiles have a category defined. |
|
Duplicate profile check: Passed - no duplicate profiles detected. |
|
Invitation URL: |
|
zigbee-switch_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against 4fb1901 |
Test Results 73 files 551 suites 0s ⏱️ Results for commit 4fb1901. ♻️ This comment has been updated with latest results. |
| local function isCCTmode(device) | ||
| local lastMode = device:get_latest_state(COMPONENT_MODE, capabilities.mode.ID, capabilities.mode.mode.NAME) or 0 | ||
| local ret = true | ||
| if lastMode == SUPPORTED_MODES[1] then ret = false end | ||
| return ret | ||
| end |
There was a problem hiding this comment.
isCCTmode returns true when the mode state is nil. A freshly paired device starts on aqara-lightstrip-rgbw, so until the 0x0509 read-back arrives, commands and reports take the CCT path. Could the fallback be rgbw, which matches the initial profile?
There was a problem hiding this comment.
Thanks for the review. The initial profile is rgbw, but the device
remembers its hardware mode across factory reset — so a re-paired
device may actually be in CCT mode until the 0x0509 read-back arrives and the profile is swapped. In that case, defaulting isCCTmode to rgbw would mean commands only reach endpoint 1 and not endpoint 2, leaving lamp2 unresponsive. We'd prefer to keep the current default for this reason.
| end | ||
|
|
||
| local function set_light_fadeInTimeState(device) | ||
| local fadeInTime = device.preferences["stse.lightFadeInTimeInSec"] * 10 |
There was a problem hiding this comment.
device.preferences["stse.lightFadeInTimeInSec"] * 10 has no nil guard. The infoChanged profile-change path calls these unconditionally, so a missing preference would raise an error. Please guard it, or fall back to the preference default.
There was a problem hiding this comment.
Fixed. Added nil guards to both set_light_fadeInTimeState
and set_light_fadeOutTimeState, and applied the same guard to
set_restore_powerState for consistency.
| device.thread:call_with_delay(MODE_CHANGE_STABILIZE_DELAY_SEC, function() | ||
| set_restore_powerState(device) | ||
| set_light_fadeInTimeState(device) | ||
| set_light_fadeOutTimeState(device) | ||
| end) |
There was a problem hiding this comment.
If the profile and a preference change in the same infoChanged, the fade and restore-power writes are sent twice. This is minor, but you could skip the per-preference branches when the profile-change branch has already handled them.
There was a problem hiding this comment.
Fixed. The profile-change branch now returns early, so the per-preference branch is skipped when both change in the same event.
| local function do_configure(driver, device) | ||
| -- The device auto-reboots (~5-8s) when its operating mode (RGB/CCT) changes. | ||
| -- Delay the refresh so we read state after the device has stabilized. | ||
| device.thread:call_with_delay(MODE_CHANGE_STABILIZE_DELAY_SEC, function() | ||
| do_refresh(driver, device) | ||
| end) | ||
| device:configure() | ||
| device:send(device_management.build_bind_request(device, OnOff.ID, driver.environment_info.hub_zigbee_eui)) | ||
| do_refresh(driver, device) | ||
| end |
There was a problem hiding this comment.
device:configure() already binds and configures reporting for the attributes the default capabilities register, so the extra build_bind_request for OnOff looks redundant. Also, is endpoint 2 bound and configured for reporting in CCT mode? If it isn’t, lamp2 may not report state changes on its own.
There was a problem hiding this comment.
Fixed the redundant OnOff bind. Removed it since device:configure() already binds and configures reporting on the fingerprinted endpoint, and dropped the now-unused device_management import.
On endpoint 2: lamp2 has no independent control path on this product — it only changes in response to hub-issued commands, so hub-side state has remained consistent in our testing. Happy to revisit if you have a specific scenario in mind.
| local hue = (cmd.args.color.hue ~= nil and cmd.args.color.hue > 99) and 99 or cmd.args.color.hue | ||
| local sat = cmd.args.color.saturation | ||
|
|
||
| local x, y, Y = utils.safe_hsv_to_xy(hue, sat) |
There was a problem hiding this comment.
If cmd.args.color.hue is nil, for example a setColor carrying only saturation, safe_hsv_to_xy(nil, sat) will error. Please fill the missing value from the latest state, like the hue/sat timer callback does.
There was a problem hiding this comment.
Fixed. hue and saturation now fall back to the latest known state when the setColor payload omits one of them, consistent with the hue/sat timer callback used by setHue / setSaturation.
| @@ -0,0 +1,442 @@ | |||
| -- Copyright 2025 SmartThings, Inc. | |||
| @@ -0,0 +1,507 @@ | |||
| -- Copyright 2025 SmartThings | |||
| local FINGERPRINTS = { | ||
| { mfr = "LUMI", model = "lumi.dimmer.rcbac1" } | ||
| } |
There was a problem hiding this comment.
FINGERPRINTS is rebuilt on every can_handle call. Please move it to module level, or into aqara-strip/fingerprints.lua as other sub-drivers do.
There was a problem hiding this comment.
Fixed. Extracted the fingerprint table into aqara-strip/fingerprints.lua, following the pattern used by the parent aqara/ sub-driver.
| - id: colorTemperature | ||
| version: 1 |
There was a problem hiding this comment.
The CCT profile limits color temperature to 2700–6500 K, but the RGBW profile has no range config. The driver also never emits colorTemperatureRange, unlike aqara-light. Without it, the app may show a wider range than the device supports. Could you add the same 2700–6500 range, or emit colorTemperatureRange in added?
There was a problem hiding this comment.
Fixed. Added range [2700, 6500] to the colorTemperature capability in aqara-lightstrip-rgbw.yml so it matches the CCT profile.
Both modes share the same color temperature range on this device.
| model: lumi.light.cwacn1 | ||
| deviceProfileName: aqara-light | ||
| - id: "LUMI/lumi.dimmer.rcbac1" | ||
| deviceLabel: Aqara Smart LED Strip Driver |
There was a problem hiding this comment.
nit: Should this just be Aqara Smart LED Strip?
There was a problem hiding this comment.
Thanks for the suggestion. "Aqara Smart LED Strip Driver"(lumi.dimmer.rcbac1, retail code ZNDDMK11LM) is a distinct product from the "Aqara LED Strip T1" consumer light strip — the former is a standalone controller module for LED strips. Dropping "Driver" would make the two indistinguishable, so we'd like to keep the current label.
|
Hi @haedo-doo, thanks for the updates. The fixes look good. One more request before we can merge. The STTS results you provided were run on aqara-lightstrip-rgbw. Could you also run STTS on the aqara-lightstrip-cct profile and share a link to the results? Please run it with both LED strips connected (lamp1 and lamp2) so that CCT mode is exercised end to end. Once we have the CCT STTS results and you've updated the branch and resolved conflicts, we should be able to move forward with merging. |
| if isCCTmode(device) then curMode = SUPPORTED_MODES[2] end | ||
| for _, i in ipairs(COMPONENT_INFO_TABLE) do | ||
| if i.supportMode == curMode and i.endPoint == srcEndpoint then | ||
| device:emit_component_event(device.profile.components[i.name], evt) |
There was a problem hiding this comment.
In onoff_handler, an endpoint 1 report is emitted to both main and lamp1, but an endpoint 2 report is emitted only to lamp2. In CCT mode that makes main follow lamp1 and ignore lamp2. As a result:
lamp1off forcesmainOff even iflamp2is still On. STTS requiresmain=On,lamp1=Off, so it can never reach that state.lamp2on whilelamp1is off leavesmainOff even though a strip is lit.
What should main represent in CCT mode? My suggestion is “On if either lamp is On”, which would:
- keep
mainconsistent with what’s lit, - make
main=On,lamp1=Offreachable (mainon, thenlamp1off leaveslamp2On), and
keepmainon/off commands going to both endpoints, as they do now.
If you agree, please:
- emit each endpoint’s report to its own lamp component, then emit
mainas On if either lamp is On, - treat an unknown lamp state as Off,
- leave RGBW mode unchanged
- update the unit tests that assert
mainmirroringlamp1.
Then please rerun STTS on aqara-lightstrip-cct with both strips connected.
If you intend main to track lamp1 only, please tell us why. The STTS precondition can’t be met that way, so we’d need to take it up with the certification team.
There was a problem hiding this comment.
Hi @cbaumler, thanks again for the detailed review suggestions — they were very helpful.
The CCT main-state handling has been updated and STTS now passes;
results are attached below. Conflicts with main have also been resolved.
Please let me know if there's anything else you'd like me to address before merging.
STTS result: https://developer.smartthings.com/console/test/sessions/TNW7MHCZ35
There was a problem hiding this comment.
Thanks @haedo-doo, the changes look good to me. We can merge this once the certification team has reviewed and approved the STTS results.
…DStripDriver # Conflicts: # drivers/SmartThings/zigbee-switch/src/sub_drivers.lua
| do_refresh(driver, device) | ||
| end) | ||
| device:configure() | ||
| do_refresh(driver, device) |
There was a problem hiding this comment.
Why is this immediate refresh needed as well as one that is delayed 10sec?
| do_refresh(driver, device) |
cjswedes
left a comment
There was a problem hiding this comment.
There is a lot of duplication of functionality in our defaults when in RGBW mode, that I wish we could easily avoid doing, but I dont see an elegant way to do it.
Check all that apply
Type of Change
Checklist
Description of Change
Summary of Completed Tests