Skip to content

Conversation

@hcarter-775
Copy link
Contributor

@hcarter-775 hcarter-775 commented Dec 29, 2025

Description of Change

Update all profiles to support statelessStep capabilities as needed. Include handlers for these step capabilities using the Matter-provided step commands.

This breaks apart the work found in #2669 so that the stateless capability support can be reviewed as an isolated unit.

Summary of Completed Tests

Unit tests added. Tested on-device.

@github-actions
Copy link

Duplicate profile check: Warning - duplicate profiles detected.
light-color-level-2200K-6500K.yml == light-color-level.yml
light-level-colorTemperature-2200K-6500K.yml == light-level-colorTemperature.yml

@github-actions
Copy link

@github-actions
Copy link

github-actions bot commented Dec 29, 2025

Test Results

   71 files    481 suites   0s ⏱️
2 482 tests 2 330 ✅ 0 💤 0 ❌ 152 🔥
4 263 runs  4 026 ✅ 0 💤 0 ❌ 237 🔥

For more details on these errors, see this check.

Results for commit 987716d.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Dec 29, 2025

File Coverage
All files 42%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/init.lua 76%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/event_handlers.lua 24%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/capability_handlers.lua 20%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua 13%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/color_utils.lua 9%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua 17%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua 99%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/utils.lua 18%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/embedded_cluster_utils.lua 32%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 987716d

local endpoint_id = device:component_to_endpoint(cmd.component)
-- before the Matter 1.3 lua libs update (HUB FW 55), there was no ColorControl StepModeEnum type defined
local step_mode = step_percent_change > 0 and (clusters.ColorControl.types.StepModeEnum.DOWN or 3) or (clusters.ColorControl.types.StepModeEnum.UP or 1)
local min_mireds = switch_utils.get_field_for_endpoint(device, fields.COLOR_TEMP_BOUND_RECEIVED_MIRED..fields.COLOR_TEMP_MIN, endpoint_id) or 2200 -- default min mireds
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value for min_mireds is 2200 which is a kelvin value instead of mired. Also, mired and kelvin have an inverse relationship so the default minimum mired should match the default maximum kelvin value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch 👍

Comment on lines 129 to 130
-- before the Matter 1.3 lua libs update (HUB FW 55), there was no ColorControl StepModeEnum type defined
local step_mode = step_percent_change > 0 and (clusters.ColorControl.types.StepModeEnum.DOWN or 3) or (clusters.ColorControl.types.StepModeEnum.UP or 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this comment, does this line need to be something like this?

Suggested change
-- before the Matter 1.3 lua libs update (HUB FW 55), there was no ColorControl StepModeEnum type defined
local step_mode = step_percent_change > 0 and (clusters.ColorControl.types.StepModeEnum.DOWN or 3) or (clusters.ColorControl.types.StepModeEnum.UP or 1)
-- before the Matter 1.3 lua libs update (HUB FW 55), there was no ColorControl StepModeEnum type defined
local step_mode = step_percent_change > 0 and (clusters.ColorControl.types.StepModeEnum and clusters.ColorControl.types.StepModeEnum.DOWN or 3) or (clusters.ColorControl.types.StepModeEnum and clusters.ColorControl.types.StepModeEnum.UP or 1)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch 👍

@@ -0,0 +1,15 @@
name: Stateless Color Temperature Step
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These capabilities are available in the capabilities repo - can they be removed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I think so.

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.

4 participants