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 13 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    442 suites   0s ⏱️
2 264 tests 2 264 ✅ 0 💤 0 ❌
3 862 runs  3 862 ✅ 0 💤 0 ❌

Results for commit f2e532c.

♻️ 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/embedded-cluster-utils.lua 38%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/aqara-cube/init.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/init.lua 93%
/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%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against f2e532c

@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
@nickolas-deboom
Copy link
Contributor

I'm trying to remember but can't quite recall, I think you mentioned that these changes would result in re-profiling for certain devices that would currently not be re-profiled and just rely on fingerprints, is that the case?

@hcarter-775
Copy link
Contributor Author

I'm trying to remember but can't quite recall, I think you mentioned that these changes would result in re-profiling for certain devices that would currently not be re-profiled and just rely on fingerprints, is that the case?

@nickolas-deboom yes, that's true. See the assign_switch_profile call at the bottom of match_profile, that will be called for all switch devices that didn't get an early return due to previous specific handling.

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