Skip to content

Matter Switch: Register setColorTemperature native handler#2988

Open
hcarter-775 wants to merge 2 commits into
mainfrom
support/set-color-temperature-native-handler
Open

Matter Switch: Register setColorTemperature native handler#2988
hcarter-775 wants to merge 2 commits into
mainfrom
support/set-color-temperature-native-handler

Conversation

@hcarter-775
Copy link
Copy Markdown
Contributor

@hcarter-775 hcarter-775 commented May 20, 2026

Description of Change

We currently only attempt native handler registration in the default handler for the setColorTemperature -> Matter command. This means that no devices actually using the Matter Switch driver will use this native handler.

I also renamed the variable, since mostRecentTemp is 1. pretty inaccurate for what's actually going on, and 2. is very unclear.

I also de-persisted the variable to match the default handler, and therefore the native handler expectations. Since this is only used to store command state, we have no need to persist this.

Summary of Completed Tests

This native handler has been in production for a while, so testing is fairly sufficient. This just adds the actual registration.

Some unit tests updated, and while checking the failing tests I removed a couple effectively duplicate tests, as a part of the general cleanup work I've been doing to not duplicate tests, for more effective development moving forward. To "extra" prove these tests were repetitions, the luacov analyzer didn't notice any drop in testing coverage.

2026-05-20T17:42:47.428149367Z INFO Matter Switch  <MatterDevice: 2a93fa5f-29bc-4e29-bcb6-139aafb56bae [1D988282F1D82423-50221DCCC136EE1A] (Matter Color Light)> registering for colorTemperature:setColorTemperature command to be handled natively
2026-05-20T17:42:47.505209367Z INFO Matter Switch  <MatterDevice: 2a93fa5f-29bc-4e29-bcb6-139aafb56bae [1D988282F1D82423-50221DCCC136EE1A] (Matter Color Light)> sending InteractionRequest: <InteractionRequest || type: INVOKE, info_blocks: [<InteractionInfoBlock || endpoint: 0x16, cluster: ColorControl, command: MoveToColorTemperature, data: Structure: {options_mask: \x01, options_override: \x01, transition_time: \x00\x00, color_temperature_mireds: \x01\x11, }>]>

....

2026-05-20T17:43:27.258294705Z INFO Matter Switch  hub handled command: 2a93fa5f-29bc-4e29-bcb6-139aafb56bae:main:colorTemperature:setColorTemperature [3698]
2026-05-20T17:43:27.259362122Z INFO Matter Switch  hub sending: Interaction request (2a93fa5f-29bc-4e29-bcb6-139aafb56bae): <type: Invoke, info_blocks: [<endpoint: 0x16, cluster: 0x300, command: 0x0a, tlv: [15, 25, 00, 0e, 01, 24, 01, 00, 24, 02, 01, 24, 03, 01, 18]>], timed: false

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

Test Results

   72 files  ±0    511 suites  ±0   0s ⏱️ ±0s
2 865 tests  - 2  2 865 ✅  - 2  0 💤 ±0  0 ❌ ±0 
4 737 runs   - 3  4 737 ✅  - 3  0 💤 ±0  0 ❌ ±0 

Results for commit 87da728. ± Comparison against base commit a80ea6f.

This pull request removes 2 tests.
Switch capability should send the appropriate commands
Switch child device: Set color temperature should send the appropriate commands

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

File Coverage
All files 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/aqara_cube/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/embedded_cluster_utils.lua 38%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/utils.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/utils.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/device_configuration.lua 94%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/third_reality_mk1/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/eve_energy/init.lua 91%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/capability_handlers.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua 80%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/event_handlers.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/init.lua 87%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_handlers/event_handlers.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/attribute_handlers.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/capability_handlers.lua 84%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/init.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/init.lua 97%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 87da728

@hcarter-775 hcarter-775 force-pushed the support/set-color-temperature-native-handler branch from 03e96de to 87da728 Compare May 20, 2026 15:52
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.

2 participants