Skip to content

Add Schlage Sense Pro UWB settings on modular lock profiles - #3303

Open
Kwang-Hui wants to merge 5 commits into
SmartThingsCommunity:mainfrom
Kwang-Hui:feature/schlage-sense-pro-uwb
Open

Kwang-Hui wants to merge 5 commits into
SmartThingsCommunity:mainfrom
Kwang-Hui:feature/schlage-sense-pro-uwb

Conversation

@Kwang-Hui

@Kwang-Hui Kwang-Hui commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Check all that apply

Type of Change

  • WWST Certification Request
    • If this is your first time contributing code:
      • I have reviewed the README.md file
      • I have reviewed the CODE_OF_CONDUCT.md file
      • I have signed the CLA
    • I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • Bug fix
  • New feature
  • Refactor

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have verified my changes by testing with a device or have communicated a plan for testing
  • I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

This PR adds the Schlage Sense Pro (Aliro) UWB settings subdriver.

lockUwbApproachSettings and lockUwbModeSettings are optional capabilities on the existing lock-modular and lock-modular-embedded-unlatch profiles. The Schlage fingerprint stays on lock-modular.

Modular profiling lives in device_configuration.lua and is shared with the base driver, including the battery field, unlatch profile, and optional-capability change guard. The subdriver registers the two UWB capabilities for Allegion vendor 0x1236 / product 0x3800 (or the custom UWB cluster). Previously onboarded locks pick up the capabilities on init when either one is missing.

Cluster reads and writes live in schlage_utils.lua. If neither the custom cluster nor DoorLock is present, the endpoint lookup returns nil and the write is skipped.

Summary of Completed Tests

  • python3 tools/run_driver_tests.py -vv -f "matter-lock": 178/178 passed
  • luacheck --config .github/workflows/.luacheckrc on the modified Lua files: 0 warnings / 0 errors

…file

- Introduce subdriver for Schlage Sense Pro (Aliro) door lock with UWB support
- Add lock-modular-uwb-settings profile supporting lockUwbApproachSettings and lockUwbModeSettings
- Implement scaffold for Matter Manufacturer-Specific Cluster communication
- Link subdriver lifecycle and modular profile matching in matter-lock
- Add unit and integration tests covering subdriver matcher, lifecycle, commands, and attribute reports
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Duplicate profile check: Warning - duplicate profiles detected.
lock-modular-embedded-unlatch.yml == lock-modular.yml

@github-actions

Copy link
Copy Markdown

Profile category check: ✅ Passed - all profiles have a category defined.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

matter-lock_coverage.xml

File Coverage
All files 91% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/unmigrated-matter-lock/init.lua 92% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/lock_utils.lua 89% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/lazy_load_subdriver.lua 57% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/init.lua 90% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/device_configuration.lua 99% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/schlage-sense-pro/init.lua 93% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/schlage-sense-pro/schlage_utils.lua 98% ✅

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 34b47b7

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Test Results

   73 files    546 suites   0s ⏱️
3 325 tests 3 325 ✅ 0 💤 0 ❌
5 325 runs  5 325 ✅ 0 💤 0 ❌

Results for commit 34b47b7.

♻️ This comment has been updated with latest results.

- In schlage-sense-pro device_init, automatically upgrade previously onboarded locks
  missing lockUwbApproachSettings to lock-modular-uwb-settings
- In match_profile_modular, check supports_capability_by_id for lockUwbApproachSettings
- In can_handle, support hybrid matching on Vendor ID alongside Product ID or custom cluster
- Clean up comment references to match lock-modular-uwb-settings profile name
- Add unit test covering device_init migration on driver update
- Revert changes to src/init.lua, keeping the base driver completely generic
- Move all profiling, doConfigure shadowing, and battery/feature attribute handling into schlage-sense-pro subdriver
- Follows the self-contained subdriver architecture from matter-sensor and matter-switch
- Verify all 177 matter-lock unit tests pass
Sharing match_profile_modular avoids a second profile and keeps battery, unlatch, and capability-change checks on one path.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Kwang-Hui Kwang-Hui changed the title Add Schlage Sense Pro UWB subdriver and lock-modular-uwb-settings profile Add Schlage Sense Pro UWB settings on modular lock profiles Oct 28, 2026
@Kwang-Hui

Copy link
Copy Markdown
Contributor Author

@hcarter-775 Thanks again for the review. The comments are addressed in 34b47b7, and the threads are resolved.

Could you take another look when you have a chance?

}

-------------------------------------------------------------------------------------
-- Fallback Capability Builders (Pre-27R1 Compatibility)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We shouldn't actually need this stuff below, I don't think. The capability definitions themselves are not dependent on any R1 stuff, and are available in this exact state already, today. I'd suggest removing this for ease of understanding, since it's not needed.

Comment on lines +7 to +8
--- 1. Confluence: "Schlage Sense Pro (Aliro) - UWB Configuration and Feature Support" (Page 5350097136)
--- 2. Confluence: "Action plan for Schlage UWB configuration" (Page 5392597723)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I recommend we remove the confluence documents, since this is a customer-facing repo

Comment on lines +7 to +8
---
--- Supports both initial onboarding and OTA driver updates for previously onboarded locks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove this line? Seems unclear what it is describing to me

Comment on lines 297 to +298
local function match_profile(driver, device, ignore_static_profiling)
if profiling_data_still_required(device) then return end
if version.api >= 15 and version.rpc >= 9 then
match_profile_modular(driver, device)
elseif ignore_static_profiling ~= true then
match_profile_switch(driver, device)
end
device_configuration.match_profile(driver, device, ignore_static_profiling)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: since you're just calling match_profile in match_profile, maybe we should just explicitly put this call (device_configuration.match_profile) in the locations currently calling match_profile? Btw, thanks for cleaning this up!

--- Register extra optional capabilities contributed by a subdriver.
--- The provider is called with the device and returns a list of capability ids, or nil.
--- @param provider fun(device: Device): string[]|nil
function device_configuration.register_optional_capabilities(provider)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure this special handling that always adds the Schlage capabilities is actually being processed anymore? Could you double check this works as you expect, given my recent suggestions about cleaning up the match_profile logic?

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