Repository navigation
Matter lock: Update embedded cluster definitions and drop alias uses - #3388
hcarter-775 wants to merge 4 commits into
Conversation
- Swap in the embedded `DoorLock` cluster for api < 11, matching driver - Use canonical type names instead of Matter 1.2 aliases - Select `BatChargeLevel` vs `BatChargeLevelEnum` by api version Co-Authored-By: Claude <claude@anthropic.com>
- Regenerate from current codegen without `lazy_require` - Keep only attributes, commands, events and types the driver uses - Add missing Aliro attribute and `UnboltDoor` definitions - Strip comments and alias support Co-Authored-By: Claude <claude@anthropic.com>
- Hub libs before api 11 lack Aliro attributes, crashing on `AliroReaderVerificationKey` lookups; use embedded cluster instead - Replace alias type names with canonical names available everywhere - Handle `BatChargeLevel` naming on api 9 hubs Co-Authored-By: Claude <claude@anthropic.com>
|
Invitation URL: |
|
matter-lock_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against 3487f02 |
Test Results 73 files 584 suites 0s ⏱️ Results for commit 3487f02. ♻️ This comment has been updated with latest results. |
ctowns
left a comment
There was a problem hiding this comment.
Overall the changes make sense to me, and the refactor is clean and matches what we have in the scripting-engine.
I also confirmed that the only aliases for the DoorLock cluster are from renames during the 1.2, so there wouldn't be any intermediate hub versions that would need their aliases account for, so using the most up to date names as you have done here should be good!
Just a couple questions:
What is the scale of this issue, as in how many hubs are experiencing this crash? I don't think we've seen it called out in our monitoring at all. It looks like this is something that would have been crashing for older hubs (<53) since v54 was released if I am understanding correctly, since that AliroReaderVerificationKey field wasn't added to the lua libs until the 54 release, so I am just trying to get a better idea of the scale of this issue.
Also, is there a plan to test this against a real device? I'm not sure if we can even backport a hub that far without running into issues, so real device testing might be difficult.
| ) | ||
|
|
||
| local DlAlarmCode = clusters.DoorLock.types.DlAlarmCode | ||
| local DlAlarmCode = clusters.DoorLock.types.AlarmCodeEnum |
There was a problem hiding this comment.
nit
| local DlAlarmCode = clusters.DoorLock.types.AlarmCodeEnum | |
| local AlarmCodeEnum = clusters.DoorLock.types.AlarmCodeEnum |
This is in drivers/SmartThings/matter-lock/src/test/test_matter_lock.lua as well, so update there too
|
@ctowns , scale is low, but I see it whenever I monitor the Matter Lock driver. It is a longstanding issue that likely affects only a handful of devices, since the version it affects is so far back. Given that the version is so far back for the gates to take effect, I did not plan to test this on-device- I just expected to see that the crashes stopped on these older FW hubs. It is really only a pathing issue anyway. |
Match the embedded cluster type name per review feedback. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Description of Change
Older hubs are crashing in matter-lock with:
Hub Lua libraries didn't get the Aliro DoorLock attributes until api 11 (
v11_hc0.54.x); the api-10 libraries (v10_hc0.53.x) don't have them. The driver only used its embedded DoorLock cluster whenversion.api < 10, so api-10 hubs fell back to their own DoorLock definition and errored on the first Aliro attribute lookup during subscribe.Changes:
DoorLockcluster whenversion.api < 11(was< 10), ininit.luaandlock_sync.lua.DoorLockfrom the current scripting-engine codegen:AliroSupportedBLEUWBProtocolVersions(which the driver subscribes to) andUnboltDoorelements,SetCredential.credential_dataasOctetString2)DlAlarmCode,DlCredentialType,DoorLockFeature.PIN_CREDENTIALS, ...), which only resolve through the hub's alias tables. Without aliases in the embedded cluster, those would fail on api < 11, so they are replaced with the canonical names (AlarmCodeEnum,CredentialTypeEnum,Feature.PIN_CREDENTIAL, ...). Values are unchanged.handle_battery_charge_levelusesPowerSource.types.BatChargeLevelon api < 10, whereBatChargeLevelEnumdoesn't exist.DoorLockswap for api < 11 and use the canonical type names.Summary of Completed Tests
version.api = 10, so they exercise the embeddedDoorLockpath end to end, including the Aliro tests.added/doConfigurerather thaninit), not on driver errors.