Repository navigation
Hotfix Main -> Beta 11/13: Zigbee/Zwave Lock - #3352
Open
hcarter-775 wants to merge 9 commits into
Open
hcarter-775 wants to merge 9 commits into
hcarter-775 wants to merge 9 commits into
Conversation
…Credential/updateCredential validation (#3331) * zigbee-lock: simplify reported and commanded credential management Centralize how the lock's credential and user tables are updated after a PIN is set on the lock, whether the PIN was set by a SmartThings command or reported by the lock (sync or programming event). addCredential - The credential always takes the next available credential slot. - userIndex 0 creates a new user for the credential; the user index is chosen when the lock confirms the code (next free user index). - A non-zero userIndex must name an existing user, and the credential is attached to it. An unknown userIndex returns invalidCommand without contacting the lock. If that user vanishes before the lock confirms, it is re-added rather than failing an accepted code. - resourceExhausted is returned up front when the credentials table is full, or when a new user is requested and the users table is full. updateCredential - Only handled when the given userIndex already owns the credentialIndex (otherwise invalidCommand); a credential can no longer be moved to another user. Only the credential name can change. Reported credentials - Codes reported by the lock without a command from us get a user and PIN credential via lock_utils.add_reported_credential. Helpers - lock_utils.add_credential_and_user(device, args, add_user) adds a credential and, when add_user is true, its user afterwards so a failed credential add never leaves a user behind. - tables.next_index accepts an optional start index. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* zigbee-lock: make credential code sync more robust Sync the lock's PIN codes into the credentials/users tables more often and more reliably, and recover from failures instead of stopping early. - Start the sync from slot 0, and try it more often: on init (after a 15s delay so NumberOfPINUsersSupported is known) and on refresh. The duplicate init sync in doConfigure is dropped. - Move the sync checks into sync_device_state and continue_code_sync into lock_utils' sync section. - Skip a sync while the device is busy, expiring stale busy state so a stalled sync can be retried, rather than clobbering a command in flight. Refresh waits 15s for updates to arrive. - Persist the latest synced code index so a failed sync resumes from where it stopped, and ignore responses for any other index. - Use a bump-able CODES_SYNC_VERSION: a persisted index started under a different version is cleared, which permits a re-sync when needed. - Handle Default Responses during the sync. Default responses do not count towards the consecutive-unoccupied count that ends the sync. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* Z-Wave Lock: Ensure a default pin length is set * Z-Wave Lock: Ensure pin length bounds are set during migration
Represent the Zigbee master code pins as a programmingUser, keep it across delete-all, refuse to delete these kinds of codes, refuse to create these kinds of codes, and promote reported codes to master when the lock says so. A user cannot be changed to or from the programmingUser type via updateUser, and auto-assigned credentials start at index 1 so they never claim the master slot. Move Yale-specific handling into its own sub-driver, which normalizes Yale's misreported user ids. Extend the lockCodes migration to take the known master code slot (0 for Yale) and always migrate it as a programming user. --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
* zwave lock: standardize management of credential and user additions/update * zwave-lock: align credential/user management with zigbee-lock Co-authored-by: Cooper Towns <cooper.towns@smartthings.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…3339) * zwave lock: make sync codes more robust, add it to refresh handling * break apart occupied vs available as conceptually different * zwave-lock: ignore sync reports for other code indexes Co-authored-by: Cooper Towns <cooper.towns@smartthings.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This reverts commit 91a7498. Conflicts with later changes (#3337, #3339, #3346) in the zwave-lock tests were resolved by dropping the tests added by #3323 and keeping the lock_utils require and Schlage mock device that remaining code and tests still use. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Invitation URL: |
|
zigbee-lock_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against c1ac8ec |
|
zwave-lock_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against c1ac8ec |
Test Results 73 files 570 suites 0s ⏱️ Results for commit c1ac8ec. |
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.
Description of Change
Merging recently merged Zigbee and Zwave lock changes into beta from main.