Skip to content

Feature/support keypair generation#2815

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

Feature/support keypair generation#2815
HunsupJung wants to merge 6 commits intomainfrom
feature/support-keypair-generation

Conversation

@HunsupJung
Copy link
Collaborator

@HunsupJung HunsupJung commented Feb 27, 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

Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
@github-actions
Copy link

@github-actions
Copy link

github-actions bot commented Feb 27, 2026

Test Results

   72 files    487 suites   0s ⏱️
2 545 tests 2 545 ✅ 0 💤 0 ❌
4 385 runs  4 385 ✅ 0 💤 0 ❌

Results for commit 7200d58.

♻️ This comment has been updated with latest results.

@HunsupJung
Copy link
Collaborator Author

@tpmanley
I entered the Git command incorrectly and the PR was closed, but I couldn't open it again to see if I didn't have the authority, so I made a new one. I'm sorry to bother you.

@github-actions
Copy link

File Coverage
All files 69%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/lock_utils.lua 98%
/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 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua 61%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/new-matter-lock/can_handle.lua 90%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 7200d58

@HunsupJung
Copy link
Collaborator Author

@tpmanley

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?

First of all, I corrected all the errors.

@HunsupJung
Copy link
Collaborator Author

@ctowns
if test code uses lock-modular, the following message appears as if lockAliro capability is not supported, making it impossible to write test code. What do you suggest I do?

INFO  || <MatterDevice: 00000000-1111-2222-3333-000000000001 [nil]> received InteractionResponse: <InteractionResponse || type: REPORT_DATA, response_blocks: [<InteractionResponseInfoBlock || status: SUCCESS, <InteractionInfoBlock || endpoint: 0x01, cluster: DoorLock, attribute: AliroReaderVerificationKey, data: OctetString1: "\x04\xA9\xCB\xE4\x18\xEB\x09\x66\x16\x43\xE2\xA4\xA8\x46\xB8\xED\xFE\x27\x86\x98\x30\x2E\x9F\xB4\x3E\x9B\xFF\xD3\xE3\x10\xCC\x2C\x2C\x7F\xF4\x02\xE0\x6E\x40\xEA\x3C\xE1\x29\x43\x52\x73\x36\x68\x3F\xC5\xB1\xCB\x0C\x6A\x7C\x3F\x0B\x5A\xFF\x78\x35\xDF\x21\xC6\x24">>]>
TRACE || Found MatterMessageDispatcher handler in matter-lock -> New Matter Lock Handler
WARN  || Attempted to generate event for 00000000-1111-2222-3333-000000000001.main but it does not support capability Lock Aliro

@hcarter-775
Copy link
Contributor

@HunsupJung when you're setting up the test, you can make a mock device with the following profile
profile = t_utils.get_profile_definition("lock-modular.yml", {enabled_optional_capabilities = {{"main", {"lockAliro"}}}}),

Then run the test as normal. This will make the tested profile include the optional capability. You can add as many optional capabilities as you want in this way.

hex_string_to_octet_string(groupResolvingKey)
)
)
device:set_field(lock_utils.ALIRO_READER_CONFIG_UPDATED, true)
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be worth checking the response of SetAliroReaderConfig before setting ALIRO_READER_CONFIG_UPDATED to true, since if the command fails then set_reader_config would never retry.

command_result_info, {state_change = true, visibility = {displayed = false}}
))
device:set_field(lock_utils.BUSY_STATE, false, {persist = true})
return
Copy link
Contributor

Choose a reason for hiding this comment

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

I might be missing something but what is the reason for the early return here? It seems to me that this would result in a no-op for any subsequent setReaderConfig commands since ALIRO_READER_CONFIG_UPDATED is never cleared

subscribe_request:merge(DoorLock.attributes.OperatingMode:subscribe(mock_device_unlatch))
subscribe_request:merge(DoorLock.events.LockOperation:subscribe(mock_device_unlatch))
subscribe_request:merge(DoorLock.events.DoorLockAlarm:subscribe(mock_device_unlatch))
subscribe_request:merge(cluster_base.subscribe(mock_device, nil, DoorLockFeatureMapAttr.cluster, DoorLockFeatureMapAttr.ID))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
subscribe_request:merge(cluster_base.subscribe(mock_device, nil, DoorLockFeatureMapAttr.cluster, DoorLockFeatureMapAttr.ID))
subscribe_request:merge(cluster_base.subscribe(mock_device_unlatch, nil, DoorLockFeatureMapAttr.cluster, DoorLockFeatureMapAttr.ID))

subscribe_request:merge(DoorLock.events.LockOperation:subscribe(mock_device_user_pin))
subscribe_request:merge(DoorLock.events.DoorLockAlarm:subscribe(mock_device_user_pin))
subscribe_request:merge(DoorLock.events.LockUserChange:subscribe(mock_device_user_pin))
subscribe_request:merge(cluster_base.subscribe(mock_device, nil, DoorLockFeatureMapAttr.cluster, DoorLockFeatureMapAttr.ID))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
subscribe_request:merge(cluster_base.subscribe(mock_device, nil, DoorLockFeatureMapAttr.cluster, DoorLockFeatureMapAttr.ID))
subscribe_request:merge(cluster_base.subscribe(mock_device_user_pin, nil, DoorLockFeatureMapAttr.cluster, DoorLockFeatureMapAttr.ID))

subscribe_request:merge(DoorLock.events.LockOperation:subscribe(mock_device_user_pin_schedule_unlatch))
subscribe_request:merge(DoorLock.events.DoorLockAlarm:subscribe(mock_device_user_pin_schedule_unlatch))
subscribe_request:merge(DoorLock.events.LockUserChange:subscribe(mock_device_user_pin_schedule_unlatch))
subscribe_request:merge(cluster_base.subscribe(mock_device, nil, DoorLockFeatureMapAttr.cluster, DoorLockFeatureMapAttr.ID))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
subscribe_request:merge(cluster_base.subscribe(mock_device, nil, DoorLockFeatureMapAttr.cluster, DoorLockFeatureMapAttr.ID))
subscribe_request:merge(cluster_base.subscribe(mock_device_user_pin, nil, DoorLockFeatureMapAttr.cluster, DoorLockFeatureMapAttr.ID))

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