Repository navigation
Conversation
|
Invitation URL: |
|
zwave-lock_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against 742fcf4 |
Test Results 73 files 573 suites 0s ⏱️ Results for commit 742fcf4. ♻️ This comment has been updated with latest results. |
ctowns
force-pushed
the
zwave-lock/schlage-set-results
branch
4 times, most recently
from
November 19, 2026 21:23
993dd09 to
084d0aa
Compare
ctowns
force-pushed
the
zwave-lock/schlage-set-results
branch
from
November 19, 2026 21:28
084d0aa to
dfab261
Compare
Schlage locks refuse a PIN that is already in use by answering the UserCode Set with STATUS_NOT_AVAILABLE and a code of zeros, and send no notification. The driver counted that report as a set slot, so addCredential returned success and created a user whose PIN is not on the lock, and updateCredential returned success while the old PIN stayed in place. While an add or update is waiting, a STATUS_NOT_AVAILABLE report for that slot now returns duplicate, leaves users and credentials unchanged, and clears the busy state. The legacy (lockCodes) Schlage handler is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pending set
Some Schlage locks confirm a UserCode Set with an occupied report whose
code is masked ("**********"). On migrated locks the Schlage sub-driver
classified that report as manufacturer-specific and dropped it, so
addCredential and updateCredential never emitted a commandResult, the
credential was never recorded, and the next addCredential reused the same
slot and overwrote the PIN.
While an add or update is waiting on a slot, an occupied report for that
slot now goes to the generic handler, as a report with the code in clear
already does. Other masked reports are still consumed as before.
The pending-slot check is shared with the duplicate PIN handling
(STATUS_NOT_AVAILABLE) through is_pending_set_report.
Fixes #3365
Co-Authored-By: Pawel <41388251+kainpets@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
is_user_code_report_mfr_specific classified the same statuses that the new pending-set checks look at, and on migrated locks only two of its cases still did anything. Replace it with those two cases, checked directly in user_code_report_handler: - A report that slot 0 is available (master code changed) clears all credentials and users. - A masked or missing code in an occupied report is ignored unless a sync is running or it is for the slot an add or update is waiting on. The generic handler would otherwise apply it to whatever command is pending, whichever slot it names. Every other report goes to the generic handler. The legacy CODE_STATE lookup is dropped: only the lockCodes handler writes that field, so on a migrated lock it could only be stale and cause a clear-code report to be ignored. Adds tests for the master code reset, a masked report with no command pending, and a clear-code report with no command pending. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ctowns
force-pushed
the
zwave-lock/schlage-set-results
branch
from
November 19, 2026 23:11
be0275c to
742fcf4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Check all that apply
Type of Change
Checklist
Description of Change
Fixes #3365. Combines #3364 and #3366, which both edit
user_code_report_handlerinschlage-lock/init.lua.On migrated Schlage locks, the UserCode Report that answers an
addCredentialorupdateCredentialSet was misread in two ways:STATUS_NOT_AVAILABLEand a code of0000, and sends no notification. The driver treated that as an occupied slot. SoaddCredentialreturnedsuccessand created a user whose PIN is not on the lock, andupdateCredentialreturnedsuccesswhile the old PIN stayed.**********). The sub-driver classed that as manufacturer-specific and dropped it. NocommandResultwas emitted, the credential was not recorded, and the next add reused the same slot and overwrote the PIN.Now, while an add or update is waiting on a slot, the report for that slot is handled as follows:
STATUS_NOT_AVAILABLEduplicate. Users and credentials are unchanged and the busy state is cleared.ENABLED_GRANT_ACCESS(masked or clear code)success.Reports for other slots, and reports when no add or update is pending, are handled as before. Both checks share one helper,
is_set_reported. The legacy (lockCodes) Schlage handler is unchanged.Summary of Completed Tests
New tests in
test_schlage_lock.lua:addCredential/updateCredential: aSTATUS_NOT_AVAILABLEreport for the slot returnsduplicate, and the slot stays free.addCredential: a masked occupied report for the new slot confirms the add, and the next add goes to slot 2.addCredential/updateCredential: a masked occupied report for another slot does not confirm the command.updateCredential: a masked occupied report for the slot confirms the update.addCredential: an occupied report with a blank code confirms the add (regression check).test_schlage_lock.luapasses 8/8 andtest_schlage_lock_legacy.luapasses 8/8. The fullzwave-lockrun has the same 17 failures as unmodifiedmain(test_lock_code_slga_migration,test_lock_programming_code,test_zwave_responses). They come from the publiclua_libsmissing theprogrammingUserenum.Device testing:
\x04\xFE 0000\n\rback, and the driver reportedaddCredentialsuccess.Co-authored with @kainpets (#3366).
🤖 Generated with Claude Code