Skip to content

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

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

Switch sub-driver and main-driver to support SLGA migration#2842
HunsupJung wants to merge 4 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    515 suites   0s ⏱️
2 908 tests 2 908 ✅ 0 💤 0 ❌
4 804 runs  4 804 ✅ 0 💤 0 ❌

Results for commit 4435fa3.

♻️ 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 80%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/lock_utils.lua 69%
/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 79%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/unmigrated-matter-lock/init.lua 89%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/unmigrated-matter-lock/can_handle.lua 81%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 4435fa3

@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

local function lock_op_event_handler(driver, device, ib, response)
local tamper_detected = device:get_latest_state(
device:endpoint_to_component(ib.endopint_id),

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.

Suggested change
device:endpoint_to_component(ib.endopint_id),
device:endpoint_to_component(ib.endpoint_id),

command_result_info, {state_change = true, visibility = {displayed = false}}
))
device:set_field(lock_utils.BUSY_STATE, false, {persist = true})
end

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.

Missing return here?

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.

Yes, I will fix it.

MODULAR_PROFILE_UPDATED = "__MODULAR_PROFILE_UPDATED",
ALIRO_READER_CONFIG_UPDATED = "aliroReaderConfigUpdated",
LATEST_DOOR_LOCK_FEATURE_MAP = "latestDoorLockFeatureMap",
LOCK_CODES_COPY_REQUIRED = "lockCodesCopyRequried",

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.

Suggested change
LOCK_CODES_COPY_REQUIRED = "lockCodesCopyRequried",
LOCK_CODES_COPY_REQUIRED = "lockCodesCopyRequired",

@@ -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.

end
end

-------------------------------------------------------------

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 headers of these two functions are swapped

end
local protocol_versions = {}
for i, element in ipairs(ib.data.elements) do
local version = string.format("%s.%s", element.value:byte(1), element.value:byte(2))

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.

To avoid shadowing the module-level version:

Suggested change
local version = string.format("%s.%s", element.value:byte(1), element.value:byte(2))
local ver = string.format("%s.%s", element.value:byte(1), element.value:byte(2))

Comment on lines +640 to +641
local version = string.format("%s.%s", element.value:byte(1), element.value:byte(2))
table.insert(protocol_versions, version);

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.

To avoid shadowing the module-level version:

Suggested change
local version = string.format("%s.%s", element.value:byte(1), element.value:byte(2))
table.insert(protocol_versions, version);
local ver = string.format("%s.%s", element.value:byte(1), element.value:byte(2))
table.insert(protocol_versions, ver);

@HunsupJung HunsupJung force-pushed the feature/slga-migration branch from 068d7f9 to 7201bbd Compare June 19, 2026 06:30
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>
@HunsupJung HunsupJung force-pushed the feature/slga-migration branch 3 times, most recently from 0bc16a6 to f3f97e2 Compare June 19, 2026 07:31
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
@HunsupJung HunsupJung force-pushed the feature/slga-migration branch from f3f97e2 to 4435fa3 Compare June 19, 2026 07:34
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