Skip to content

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

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

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

Conversation

@HunsupJung
Copy link
Copy Markdown
Collaborator

@HunsupJung HunsupJung commented Mar 18, 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

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 18, 2026

Duplicate profile check: Passed - no duplicate profiles detected.

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 18, 2026

Test Results

   73 files    512 suites   0s ⏱️
2 898 tests 2 850 ✅ 0 💤 48 ❌
4 770 runs  4 722 ✅ 0 💤 48 ❌

For more details on these failures, see this check.

Results for commit 21d4cf5.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 18, 2026

File Coverage
All files 66%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/unmigrated-matter-lock/can_handle.lua 88%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/unmigrated-matter-lock/init.lua 24%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/init.lua 79%
/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/lock_utils.lua 56%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 21d4cf5

@HunsupJung HunsupJung force-pushed the feature/slga-migration branch 3 times, most recently from eb1ad32 to 9bff284 Compare May 6, 2026 08:38
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
@HunsupJung HunsupJung force-pushed the feature/slga-migration branch from 95dcb25 to 21d4cf5 Compare May 26, 2026 10:05
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
@HunsupJung HunsupJung force-pushed the feature/slga-migration branch 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);

Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
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