Skip to content

Matter Switch: Add nil check handling for electrical sensor handlers#2899

Merged
hcarter-775 merged 1 commit intomainfrom
add/nil-safety-handling
Apr 14, 2026
Merged

Matter Switch: Add nil check handling for electrical sensor handlers#2899
hcarter-775 merged 1 commit intomainfrom
add/nil-safety-handling

Conversation

@hcarter-775
Copy link
Copy Markdown
Contributor

Description of Change

Normally, these handlers should return early if the profiling_data they help populate have already been filled. However, under certain conditions, a device can 1. end up with us doing a wildcard subscription where we subscribe to every attribute/event it supports, and 2. be handled in a subdriver where the profiling data never gets populated. The fact that a subdriver/driver relationship is not necessarily of 2 distinct pieces (the partsList is an attribute supported by every device, for example) means we should probably work towards removing the separation between lifecycle handlers on generic devices (see this PR), but in the meantime we should probably fix this issue we're seeing in the field.

Summary of Completed Tests

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

Channel deleted.

@github-actions
Copy link
Copy Markdown

Test Results

   72 files    499 suites   0s ⏱️
2 740 tests 2 740 ✅ 0 💤 0 ❌
4 632 runs  4 632 ✅ 0 💤 0 ❌

Results for commit a883224.

@github-actions
Copy link
Copy Markdown

File Coverage
All files 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_handlers/event_handlers.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/init.lua 97%
/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/sub_drivers/ikea_scroll/init.lua 89%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/device_configuration.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/utils.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/init.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua 96%
/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/switch_utils/utils.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/attribute_handlers.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/capability_handlers.lua 82%
/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/switch_handlers/capability_handlers.lua 90%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua 83%
/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/third_reality_mk1/init.lua 95%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against a883224

@hcarter-775 hcarter-775 merged commit c5a2410 into main Apr 14, 2026
12 checks passed
@hcarter-775 hcarter-775 deleted the add/nil-safety-handling branch April 14, 2026 14:55
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