Skip to content

Conversation

@nickolas-deboom
Copy link
Contributor

This implements a few changes to the way that devices supporting batteries are profiled:

  • subscribe to PowerSource.AttributeList rather than reading this attribute, to help prevent failed reads from causing issues with device profiling
  • update the profile within match_profile rather than power_source_attribute_list_handler
  • use existing structure for handling waiting for profiling data before attempting a profile update

This implements a few changes to the way that devices supporting
batteries are profiled:
* subscribe to PowerSource.AttributeList rather than reading this
  attribute, to help prevent failed reads from causing issues with
  device profiling
* update the profile within match_profile rather than
  power_source_attribute_list_handler
* use existing structure for handling waiting for profiling data before
  attempting a profile update
@github-actions
Copy link

@github-actions
Copy link

github-actions bot commented Jan 21, 2026

Test Results

   71 files    482 suites   0s ⏱️
2 495 tests 2 495 ✅ 0 💤 0 ❌
4 284 runs  4 284 ✅ 0 💤 0 ❌

Results for commit b0ab7ba.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 21, 2026

File Coverage
All files 92%
/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/camera/camera_handlers/capability_handlers.lua 78%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/attribute_handlers.lua 95%
/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/sub_drivers/eve_energy/init.lua 91%
/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 89%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua 85%
/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/camera/camera_utils/utils.lua 96%
/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/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/camera/init.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/init.lua 85%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against b0ab7ba

end
if switch_utils.get_product_override_field(device, "is_climate_sensor_w100") then
profile_name = "3-button-battery-temperature-humidity"
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out that this is the only unique handling needed for this device (plus the existing logic in find_default_endpoint), so I was able to remove the extra block in power_source_attribute_list_handler

@nickolas-deboom nickolas-deboom force-pushed the matter-switch-improve-battery-profiling branch from 48c5b71 to ac6e8e6 Compare January 21, 2026 21:48
@nickolas-deboom nickolas-deboom force-pushed the matter-switch-improve-battery-profiling branch from 155c0be to b0ab7ba Compare January 28, 2026 17:39
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.

3 participants