-
Notifications
You must be signed in to change notification settings - Fork 510
CHAD-16364 & CHAD-16365: Add lockUsers and lockCredentials to profiles and also implement lockCodes:migrate functionality. #2416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Duplicate profile check: Passed - no duplicate profiles detected. |
Invitation URL: |
Test Results 71 files 454 suites 0s ⏱️ Results for commit c248678. ♻️ This comment has been updated with latest results. |
zigbee-lock_coverage.xml
zwave-lock_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against c248678 |
b8168d4
to
36fa094
Compare
36fa094
to
b303430
Compare
drivers/SmartThings/zigbee-lock/src/test/test_zigbee_lock_code_slga_migration.lua
Outdated
Show resolved
Hide resolved
drivers/SmartThings/zigbee-lock/src/test/test_zigbee_lock_code_slga_migration.lua
Outdated
Show resolved
Hide resolved
8c6dcd8
to
39cfed8
Compare
39cfed8
to
88d8d99
Compare
ecdc2be
to
c248678
Compare
|
||
table.sort(ordered_codes) | ||
for index, code_slot in ipairs(ordered_codes) do | ||
table.insert(lock_users, {userIndex = index, userType = "guest", userName = lock_codes[code_slot]}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zigbee supports other user types, and IIRC some locks like Yale do use them. It doesn't look like lockCodes
kept track of that information, but could we try to get the type with the Get User Type
command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My gut says that we should keep it simple for the migration (i.e. limit device communication), but perhaps handle it in the new capability handlers.
end | ||
|
||
for code in pairs(lock_codes) do | ||
table.insert(ordered_codes, code) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: spacing again
local min_code_len = device:get_latest_state("main", capabilities.lockCodes.ID, capabilities.lockCodes.minCodeLength.NAME) | ||
local max_code_len = device:get_latest_state("main", capabilities.lockCodes.ID, capabilities.lockCodes.maxCodeLength.NAME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the 4th (optional) argument to get_latest_state
is a default value.
you could save yourself a few lines
Check all that apply
Type of Change
Checklist
Description of Change
Summary of Completed Tests