Skip to content

Conversation

hcarter-775
Copy link
Contributor

Description of Change

Multi-switch plugs that support Electrical Sensor on multiple endpoints are not currently handled correctly in the driver, as the electrical handling is silently dropped when creating a profile for all child devices. This PR aims to fix that by adding handling of the PowerTopology cluster, a required cluster for the Electrical Sensor device type.

This cluster primarily indicates how Electrical Sensors are organized on the device through its feature map, and this PR handles 2 of the permutations, namely SET and NODE. For now, all other permutations (primarily TREE) will be silently dropped if it is supported, though we know of no real devices using this topology.

In the spec, a NODE topology indicates that there is only one source of electrical readings for the entire device, the "node". A SET topology indicates that the electrical sensor supports readings for some subset of the devices, and therefore there are likely >1 of these sensors, each with a SET topology and each supporting readings of different endpoints. These endpoints are specified through the AvailableEndpoints attribute, which we read on an initial join.

Summary of Completed Tests

Copy link

github-actions bot commented Oct 1, 2025

Copy link

github-actions bot commented Oct 1, 2025

Test Results

   71 files  ±0    452 suites  ±0   0s ⏱️ ±0s
2 344 tests ±0  2 344 ✅ ±0  0 💤 ±0  0 ❌ ±0 
3 952 runs  ±0  3 952 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 7ef7418. ± Comparison against base commit d52d763.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Oct 1, 2025

File Coverage
All files 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/utils/switch_utils.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/utils/device_configuration.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/utils/embedded_cluster_utils.lua 38%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/utils/switch_fields.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/init.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/generic_handlers/capability_handlers.lua 88%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/generic_handlers/attribute_handlers.lua 85%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/generic_handlers/event_handlers.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/aqara_cube/init.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/eve_energy/init.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/third_reality_mk1/init.lua 95%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 7ef7418

@hcarter-775 hcarter-775 changed the base branch from remove-energy-endpoint-field to main October 2, 2025 20:28
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.

1 participant