Skip to content

Add support for admin code for Yale Z-Wave lock - #3312

Open
ctowns wants to merge 4 commits into
mainfrom
zwave-admin-code
Open

ctowns wants to merge 4 commits into
mainfrom
zwave-admin-code

Conversation

@ctowns

@ctowns ctowns commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Check all that apply

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
Copy Markdown

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

zwave-lock_coverage.xml

File Coverage
All files 89% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/zwave-alarm-v1-lock/init.lua 24% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/legacy-handlers/schlage-lock/init.lua 95% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/lock_handlers/zwave_responses.lua 89% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/lock_handlers/capabilities.lua 94% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/samsung-lock/can_handle.lua 75% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/legacy-handlers/keywe-lock/init.lua 77% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/lock_utils/tables.lua 98% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/lock_utils/utils.lua 91% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/lazy_load_subdriver.lua 57% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/init.lua 94% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/schlage-lock/can_handle.lua 75% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/legacy-handlers/samsung-lock/init.lua 94% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/legacy-handlers/zwave-alarm-v1-lock/init.lua 89% ❌

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against e1f498a

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Test Results

   73 files    546 suites   0s ⏱️
3 331 tests 3 331 ✅ 0 💤 0 ❌
5 332 runs  5 332 ✅ 0 💤 0 ❌

Results for commit e1f498a.

♻️ This comment has been updated with latest results.

local associated_credentials = tables.find_all_entries_by(device, "credentials", "userIndex", command.args.userIndex)
for _, associated_credential in ipairs(associated_credentials) do
if lock_utils.is_master_credential(device, associated_credential.credentialIndex) then
-- this user holds the master code, which cannot be removed

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.

I've been thinking- maybe we should allow this to occur, and just let it fail on the device? Perhaps we shouldn't be the arbiter here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point! "Letting the device device" actually better matches the legacy behavior to begin with, so I agree with moving forward with this approach.

However, one thing I did add was a read to check whether the delete was successful. This follows legacy behavior as well, and also allows us to still send the COMMAND_RESULT.INVALID_COMMAND when the the delete fails. This way a failed attempt to delete the master code is still sent back to client for an UI that may be associated with it.

Make these changes here! e1f498a

ctowns and others added 4 commits October 30, 2026 15:09
The slot 0 / numeric ordering migration test is now covered by the
upstream tests added in #3313.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove the driver-side block on deleting the Yale master code. As in the
legacy lockCodes deleteCode, an unconfirmed delete is read back with a
User Code Get after 4.2 seconds, and a slot that is still occupied is
reported as a failure instead of leaving the command to time out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ctowns ctowns changed the title DRAFT: Add support for admin code for Yale Z-Wave lock Add support for admin code for Yale Z-Wave lock Oct 30, 2026
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