Skip to content

Conversation

@hcarter-775
Copy link
Contributor

@hcarter-775 hcarter-775 commented Oct 14, 2025

Description of Change

We store data related to the device software version (saved from the BasicInformation cluster's softwareVersion attribute) on the driver st_store. This leverages that version to attempt a re-profiling if this is ever updated. The same data is what is leveraged by the hub to re-interview a device on a device update as well.

This is built on top of the following PR: #2481 since that allows for more generic re-profiling of the parent devices.

Summary of Completed Tests

Tested that try_update_metadata works as expected for child devices.
Tested profile update logic by manually editing the software version of a device in order to trigger this logic.

@github-actions
Copy link

@github-actions
Copy link

github-actions bot commented Oct 14, 2025

Test Results

   71 files    457 suites   0s ⏱️
2 373 tests 2 373 ✅ 0 💤 0 ❌
4 005 runs  4 005 ✅ 0 💤 0 ❌

Results for commit eda1721.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 14, 2025

File Coverage
All files 92%
/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/generic_handlers/attribute_handlers.lua 83%
/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/utils/device_configuration.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/utils/switch_utils.lua 92%
/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/utils/embedded_cluster_utils.lua 38%
/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/init.lua 97%
/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/aqara_cube/init.lua 96%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against eda1721

@hcarter-775 hcarter-775 force-pushed the switch-allow-reprofiling branch from 199f355 to eda1721 Compare October 22, 2025 03:06
@hcarter-775 hcarter-775 changed the base branch from main to update-metadata-switch October 22, 2025 03:06
device:subscribe()
local button_eps = device:get_endpoints(clusters.Switch.ID, {feature_bitmap=clusters.Switch.types.SwitchFeature.MOMENTARY_SWITCH})
if #button_eps > 0 and device.network_type == device_lib.NETWORK_TYPE_MATTER then
if device.network_type == device_lib.NETWORK_TYPE_MATTER then
Copy link
Contributor

Choose a reason for hiding this comment

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

is the checking for button support done inside button_cfg?

Copy link
Contributor Author

@hcarter-775 hcarter-775 Oct 24, 2025

Choose a reason for hiding this comment

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

yes, this function will be a no-op if there are no button-mappable endpoints. So I could revert it, but it removes an extra check. Maybe this adds confusion though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thought about this more, and I improved the api by having the caller pass in the endpoints that will be mapped, still cutting out the extra check while keeping this clarity

end
end

function SwitchLifecycleHandlers.device_removed(driver, device)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just moved this to the bottom of the file. We never touch this and I personally am always getting confused where device_init is when developing with this placed above it.

@hcarter-775 hcarter-775 force-pushed the update-metadata-switch branch 2 times, most recently from fb3f845 to 73aa8dc Compare October 29, 2025 20:07
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.

4 participants