Skip to content

Conversation

@hcarter-775
Copy link
Contributor

Description of Change

This is a prerequisite for upcoming changes porting all of the device type logic from the main Matter Sensor driver into this new subdriver in the effort to consolidate and better modularize Matter device support.

I've broken the current Sensor device type support already present in Matter Switch into a subdriver first, before adding in the extra complexity inherent in porting over all the Matter Sensor logic, to clarify and converse about what a "good" generic device type subdriver should look like, and to support review of this new type of structure before adding in even more extra complexity.

As part of this groundwork, some semi-significant changes to the device:subscribe() extension can be found to account for a known issue in what is now just the camera and sensor subdrivers, the fact that there is currently no way for subdriver-specific subscribed_attributes and subscribed_events tables to be accounted for during subscription. These changes aim to create a flexible way to add subdriver-specific capability-cluster subscription tables, and to aggregate them safely as needed during subscription.

At present, this change will mostly account for some nominal memory savings for camera devices and devices not supporting any sensor handling.

Summary of Completed Tests

Very few unique devices actually use these subdriver handlers now, limiting the blast radius to a couple specific motion-button devices, the aqara climate sensor, and a couple occupancy-light devices, and these devices are all well expressed in the current driver test suite.

@hcarter-775 hcarter-775 force-pushed the move-sensor-handlers-to-switch-subdriver branch from d43bfe1 to 6c955bb Compare February 11, 2026 20:37
@github-actions
Copy link

@github-actions
Copy link

Test Results

   72 files    484 suites   0s ⏱️
2 517 tests 2 517 ✅ 0 💤 0 ❌
4 332 runs  4 332 ✅ 0 💤 0 ❌

Results for commit 6c955bb.

@github-actions
Copy link

File Coverage
All files 92%
/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_utils/utils.lua 91%
/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/sub_drivers/sensor/can_handle.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/handlers/attribute_handlers.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/handlers/capability_handlers.lua 78%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/init.lua 85%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/utils/device_configuration.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/utils/utils.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/utils/subscriptions.lua 98%
/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/switch_handlers/attribute_handlers.lua 84%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/capability_handlers.lua 89%
/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/aqara_cube/init.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/sensor/handlers/attribute_handlers.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/init.lua 97%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 6c955bb

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