Skip to content

Matter Switch: Add greater Energy profiling logic for Switches #2199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

hcarter-775
Copy link
Contributor

@hcarter-775 hcarter-775 commented Jun 16, 2025

Description of Change

Update the Matter Switch driver to support the Power Topology cluster. Specifically, include support for the Node and Set features of the cluster. Update unit tests to handle this update.

Further, update powerConsumptionReport handling to only send reports to one single capability, even when there are multiple child devices getting energy reports.

Last, update energy and power handlers from emit_event_for_endpoint() calls to emit_component_event() calls to simplify handling by avoiding the weaknesses in our current endpoint_to_component() functionality.

Summary of Completed Tests

Tests updated and continue to pass.
Tested on multi-plug energy device.
Tested on single plug energy device.

Copy link

Duplicate profile check: Passed - no duplicate profiles detected.

Copy link

Copy link

github-actions bot commented Jun 16, 2025

Test Results

   67 files    441 suites   0s ⏱️
2 263 tests 2 263 ✅ 0 💤 0 ❌
3 861 runs  3 861 ✅ 0 💤 0 ❌

Results for commit ca5b1d0.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jun 16, 2025

File Coverage
All files 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/init.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/embedded-cluster-utils.lua 38%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/third-reality-mk1/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/eve-energy/init.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/aqara-cube/init.lua 96%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against ca5b1d0

@nickolas-deboom
Copy link
Contributor

These changes look great! I think it might be a good idea to test on some additional device types since some of the init code is being changed.

@hcarter-775 hcarter-775 force-pushed the add/power-topology-handling branch from aeafdff to ca5b1d0 Compare June 18, 2025 21:50
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