Repository navigation
Add "Fetch Locks" action on lock.vendor (plain-text listing) - #99
Merged
Merged
Conversation
A header button on the vendor form connects to the vendor and shows its
locks as plain text — name and device id, one per line — in a small
transient dialog (lock.list.wizard), so an operator can read the device
ids needed to configure rooms without digging through the vendor backend.
The action calls connector.list_locks() and formats the result; the
per-vendor implementation of list_locks() (returning [{"id","name"}])
lands next in each lock library. Vendors without it get a clear
UserError instead of a traceback.
_sync_remove was updated to pass pin=self.pin to revoke_access (for vendors that re-resolve live state), but the happy-path test still expected the call without it. Assert the pin kwarg too.
Diff CoverageDiff: origin/16.0...HEAD, staged and unstaged changes
Summary
|
Cover the listing action that had no coverage: happy path (renders name<TAB>id per line into the wizard), empty result placeholder, and the NotImplementedError -> UserError path for vendors that can't list.
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.
What
A header button "Fetch Locks" on the
lock.vendorform connects to the vendor and shows its locks as plain text — name and device id, one per line — in a small transient dialog (lock.list.wizard). Lets an operator read the device ids needed to configure rooms without digging through the vendor backend.The action always calls the same
connector.list_locks()(the Odoo layer stays vendor-agnostic) and catchesNotImplementedErrorto show a friendlyUserErrorfor vendors that don't expose a listing.Dependency
Depends on the library PR commitsun/roomdoo-smartlocks#23, which adds
list_locks()to the provider contract (default raisesNotImplementedError; TESA/TTLock/Omnitec/Salto implement it). Merge that first solist_locks()exists on the lib'smain.Notes
lock.list.wizard(vendor_id+lock_listingText), security entry for the smartlock admin group, view + manifest wiring.-uon the test DB).