Skip to content

[ADD] pms_smartlock_salto: Salto KS vendor + base hooks - #86

Merged
jesusVMayor merged 5 commits into
16.0from
16.0_add_smartlock_salto
Jun 19, 2026
Merged

jesusVMayor merged 5 commits into
16.0from
16.0_add_smartlock_salto

Conversation

@jesusVMayor

Copy link
Copy Markdown
Member

Adds the Salto KS vendor to the smartlock integration. Pairs with library PR commitsun/roomdoo-smartlocks#18 (feat/salto-license-lifecycle).

Salto is user-centric (a guest = a site user assigned to a lock group), unlike the passcode vendors. All Salto-specific behaviour lives in this module; the base contract is untouched.

pms_smartlock_salto

  • lock.vendor dispatch + get_connector. Guest identity is passed per reservation via context (_sync_create sets it): the guest name fills the Salto user and the reservation locator labels the access group, so the hotel can tell whose credential is whose. Email is deliberately not sent — Salto would email the guest, and PIN delivery is a separate concern.
  • salto.role submodel + "Fetch Salto roles" button (role ids are unique per site, so they're pulled from the API; the operator picks the basic User role — never admin).
  • Keypad confirm key default = Enter (↵, U+21B5).
  • purged flag + retention cron: revoke_access only suspends the user (frees the per-user license, disables the PIN); this cron hard-deletes the suspended grant 15 days after checkout.

pms_smartlock_base (minimal hooks, vendor-agnostic)

  • _apply_grant keeps the stored PIN when the vendor reports it unchanged (AccessGrant.pin=None) instead of overwriting it on modify.
  • _sync_create puts the reservation on the context for user-centric vendors; other vendors ignore it.

Notes

  • Depends on the library PR being merged to main (requirements points at @main).
  • Needs SALTO_CLIENT_ID / SALTO_CLIENT_SECRET in the deployment env.
  • Odoo tests written (test_vendor, test_purge_cron) but not run here — left to CI on a clean DB.

@jesusVMayor
jesusVMayor changed the base branch from 16.0_add_smartlocks_integration to 16.0 June 12, 2026 06:56
@jesusVMayor
jesusVMayor force-pushed the 16.0_add_smartlock_salto branch 2 times, most recently from 4a36095 to 6016286 Compare June 12, 2026 07:15
@github-actions

github-actions Bot commented Jun 12, 2026 •

Copy link
Copy Markdown

Diff Coverage

Diff: origin/16.0...HEAD, staged and unstaged changes

  • pms_smartlock_base/models/lock_code.py (100%)
  • pms_smartlock_salto/models/lock_code.py (100%)
  • pms_smartlock_salto/models/lock_vendor.py (100%)
  • pms_smartlock_salto/models/salto_role.py (100%)

Summary

  • Total: 84 lines
  • Missing: 0 lines
  • Coverage: 100%

@jesusVMayor
jesusVMayor force-pushed the 16.0_add_smartlock_salto branch 2 times, most recently from 2947802 to d49b227 Compare June 12, 2026 07:48
@jesusVMayor
jesusVMayor marked this pull request as ready for review June 16, 2026 13:31
Salto KS smartlock provider for the PMS.

pms_smartlock_salto:
- lock.vendor dispatch + get_connector; guest identity passed per
  reservation via context (name + access-group label). Email is
  deliberately not sent so Salto does not email the guest.
- salto.role submodel + "Fetch Salto roles" button so the operator picks
  the basic User role (role ids are unique per site).
- Enter (U+21B5) keypad confirm key default.
- purged flag + retention cron that hard-deletes suspended grants 15 days
  after checkout (revoke only suspends to free the license).

pms_smartlock_base:
- _apply_grant keeps the stored PIN when the vendor reports it unchanged
  (AccessGrant.pin=None), instead of overwriting it on modify.
- _sync_create puts the reservation on the context for user-centric
  vendors; other vendors ignore it.
Salto enforces time-schedule datetimes in the IQ's local timezone (the
hotel's), not UTC; pass pms.property.tz on the context so the connector
localizes the window. Also guard single-word/empty guest names, which
left last_name blank and made Salto reject the user.
@jesusVMayor
jesusVMayor force-pushed the 16.0_add_smartlock_salto branch from cb2f1fb to b970e23 Compare June 17, 2026 06:49
@jesusVMayor

Copy link
Copy Markdown
Member Author

commitsun/roomdoo-smartlocks#18 ya mergeado, via libre a este

@jesusVMayor
jesusVMayor merged commit d39590e into 16.0 Jun 19, 2026
1 check passed
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.

1 participant