Skip to content

Support keypair generation for Aliro#2682

Open
HunsupJung wants to merge 5 commits intomainfrom
feature/support-keypair-generation
Open

Support keypair generation for Aliro#2682
HunsupJung wants to merge 5 commits intomainfrom
feature/support-keypair-generation

Conversation

@HunsupJung
Copy link
Collaborator

@HunsupJung HunsupJung commented Jan 2, 2026

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

Summary of Completed Tests

@github-actions
Copy link

github-actions bot commented Jan 2, 2026

@github-actions
Copy link

github-actions bot commented Jan 2, 2026

Test Results

   71 files    485 suites   0s ⏱️
2 518 tests 2 450 ✅ 0 💤 68 ❌
4 332 runs  4 248 ✅ 0 💤 84 ❌

For more details on these failures, see this check.

Results for commit 9a784e9.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 2, 2026

File Coverage
All files 35%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua 15%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/init.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/lock_utils.lua 98%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 9a784e9

Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
@HunsupJung HunsupJung force-pushed the feature/support-keypair-generation branch from ed58efb to 0cf840f Compare January 2, 2026 06:38
@Kwang-Hui
Copy link
Contributor

@tpmanley Could you please review this PR?

Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
@HunsupJung HunsupJung force-pushed the feature/support-keypair-generation branch from 3268f4c to 140482b Compare February 5, 2026 02:06
end
end
end
if device.manufacturer_info.vendor_id == 0x135D then
Copy link
Contributor

Choose a reason for hiding this comment

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

We should try to avoid vendor specific checks like this. Any reason we can't just subscribe to the attribute on all devices?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I coded it because I thought @ctowns wanted it to be applied only to specific devices. If I misunderstood, I will delete it.
https://samsung.slack.com/archives/C063J01GHR6/p1765382793593279?thread_ts=1732583132.684279&cid=C063J01GHR6

Copy link
Contributor

Choose a reason for hiding this comment

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

After further discussion, this attribute would be useful for other locks than just this device, so I think we should subscribe to the attribute for all relevant devices by adding it to the subscribed attributes list like this:

DoorLockFeatureMapAttr = {ID = 0xFFFC, cluster = 0x0101}
local subscribed_attributes = {
  [capabilities.lock.ID] = {
    DoorLock.attributes.LockState,
    DoorLockFeatureMapAttr -- added here
  },
  [capabilities.remoteControlStatus.ID] = {
    DoorLock.attributes.OperatingMode
  },
  [capabilities.lockUsers.ID] = {
    DoorLock.attributes.NumberOfTotalUsersSupported
  },
  [capabilities.lockCredentials.ID] = {
    DoorLock.attributes.NumberOfPINUsersSupported,
    DoorLock.attributes.MaxPINCodeLength,
    DoorLock.attributes.MinPINCodeLength,
    DoorLock.attributes.RequirePINforRemoteOperation
  },
  [capabilities.lockSchedules.ID] = {
    DoorLock.attributes.NumberOfWeekDaySchedulesSupportedPerUser,
    DoorLock.attributes.NumberOfYearDaySchedulesSupportedPerUser
  },
  [capabilities.lockAliro.ID] = {
    DoorLock.attributes.AliroReaderVerificationKey,
    DoorLock.attributes.AliroReaderGroupIdentifier,
    DoorLock.attributes.AliroReaderGroupSubIdentifier,
    DoorLock.attributes.AliroExpeditedTransactionSupportedProtocolVersions,
    DoorLock.attributes.AliroGroupResolvingKey,
    DoorLock.attributes.AliroSupportedBLEUWBProtocolVersions,
    DoorLock.attributes.AliroBLEAdvertisingVersion,
    DoorLock.attributes.NumberOfAliroCredentialIssuerKeysSupported,
    DoorLock.attributes.NumberOfAliroEndpointKeysSupported,
  },
  [capabilities.battery.ID] = {
    PowerSource.attributes.BatPercentRemaining
  },
  [capabilities.batteryLevel.ID] = {
    PowerSource.attributes.BatChargeLevel
  }
}

Sorry for suggesting the other way originally! I think you can remove this vendor-specific check and make the change above so that this attribute will be available for add devices now 👍

@HunsupJung HunsupJung requested a review from ctowns February 6, 2026 10:12
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
@tpmanley
Copy link
Contributor

tpmanley commented Feb 6, 2026

Thanks for the making the requested changes @HunsupJung . The driver code is looking pretty good to me now. In addition to what @ctowns suggested, can you also take a look at the unit tests failures reported by CI and try to add tests for the new code?

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