Skip to content

Switch sub-driver and main-driver to support SLGA migration#2842

Open
HunsupJung wants to merge 8 commits into
mainfrom
feature/slga-migration
Open

Switch sub-driver and main-driver to support SLGA migration#2842
HunsupJung wants to merge 8 commits into
mainfrom
feature/slga-migration

Conversation

@HunsupJung

@HunsupJung HunsupJung commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator

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

https://smartthings.atlassian.net/wiki/spaces/STHK/pages/5328012565/SLGA+migration+-+Test+Result

@github-actions

github-actions Bot commented Mar 18, 2026

Copy link
Copy Markdown

Duplicate profile check: Passed - no duplicate profiles detected.

@github-actions

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Mar 18, 2026

Copy link
Copy Markdown

Test Results

   73 files    522 suites   0s ⏱️
3 026 tests 3 025 ✅ 0 💤 1 ❌
4 944 runs  4 943 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit bd6ecc6.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Mar 18, 2026

Copy link
Copy Markdown

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

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against bd6ecc6

@HunsupJung HunsupJung force-pushed the feature/slga-migration branch 3 times, most recently from eb1ad32 to 9bff284 Compare May 6, 2026 08:38
@HunsupJung HunsupJung force-pushed the feature/slga-migration branch 2 times, most recently from d6d06b2 to d0d0d76 Compare May 26, 2026 11:57
Comment thread drivers/SmartThings/matter-lock/src/unmigrated-matter-lock/init.lua Outdated
Comment thread drivers/SmartThings/matter-lock/src/init.lua
Comment thread drivers/SmartThings/matter-lock/src/lock_utils.lua Outdated
@@ -0,0 +1,758 @@
-- Copyright 2025 SmartThings, Inc.

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.

The unit test coverage of this file is currently only 24% so can you add more tests to get more coverage?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

okay, I will improve the coverage.

Comment thread drivers/SmartThings/matter-lock/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-lock/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-lock/src/init.lua Outdated
@HunsupJung HunsupJung force-pushed the feature/slga-migration branch 5 times, most recently from f3f97e2 to 4435fa3 Compare June 19, 2026 07:34
@HunsupJung HunsupJung requested a review from tpmanley June 23, 2026 08:58
@HunsupJung HunsupJung added the CGAI Contains code that was generated by AI label Jun 26, 2026
@HunsupJung HunsupJung force-pushed the feature/slga-migration branch from 49f9112 to b9b8851 Compare June 26, 2026 07:07

@hcarter-775 hcarter-775 left a comment

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.

looks good!

Comment thread drivers/SmartThings/matter-lock/src/unmigrated-matter-lock/can_handle.lua Outdated
Comment thread drivers/SmartThings/matter-lock/src/unmigrated-matter-lock/can_handle.lua Outdated
Comment thread drivers/SmartThings/matter-lock/src/unmigrated-matter-lock/can_handle.lua Outdated
Comment on lines +10 to +11
local is_migrated = device:get_latest_state("main", capabilities.lockCodes.ID, capabilities.lockCodes.migrated.NAME) or nil
if device:supports_capability(capabilities.lockCodes) and is_migrated ~= true then

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 should check if lockCodes is supported before checking the latest state.

Also, the capability cache could be flushed for some reason. I'd persist a field with this data instead of directly using the latest state.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Okay I will use LOCK_CODES_COPY_REQUIRED to use field

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.

Hi Hunsup, sorry for the confusion here, I should have resolved this comment since you are now actually changing profiles for these devices (so lockCodes will not be supported any longer once the migraton is done).

Therefore, I think you should probably bring it back to how it was before!

Comment thread drivers/SmartThings/matter-lock/src/unmigrated-matter-lock/can_handle.lua Outdated
Comment thread drivers/SmartThings/matter-lock/src/init.lua
Comment thread drivers/SmartThings/matter-lock/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-lock/src/init.lua Outdated
HunsupJung and others added 8 commits July 6, 2026 20:35
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>
…_handle.lua

Co-authored-by: Harrison Carter <137556605+hcarter-775@users.noreply.github.com>
…_handle.lua

Co-authored-by: Harrison Carter <137556605+hcarter-775@users.noreply.github.com>
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
@HunsupJung HunsupJung force-pushed the feature/slga-migration branch from ee2aa47 to bd6ecc6 Compare July 6, 2026 11:42
@HunsupJung HunsupJung requested a review from hcarter-775 July 6, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CGAI Contains code that was generated by AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants