allow_external_modifications on the access code.
Seam treats these changes as external modifications:
- The PIN changed.
- The schedule changed.
- The code was removed.
- The code was deactivated: it is still on the device but disabled or suspended. Only some lock providers support this.
allow_external_modifications to true when you create or update an access code, or when you convert an unmanaged access code to managed. For an example request, see Managing Access Codes in Manufacturer Apps.
Codes That Do Not Allow External Modifications
By default, Seam keeps the access code on the device the way it is on Seam, and undoes changes made outside Seam.- When Seam detects that the PIN or schedule was changed, or that the code was removed or deactivated, it adds a
conflicting_external_modificationserror to the access code and sets the code on the device back to the way it is on Seam. Seam sends no event at this point, and the access code itself does not change. - Once the device has the code the way it is on Seam again, the error clears.
- If the device still does not match one hour after the error was added, Seam emits
access_code.failed_to_revert_external_modifications. Seam keeps trying, and the error stays until the device matches.
access_code.failed_to_revert_external_modifications describes what is still different on the device:
- For a changed PIN or schedule,
modified_fromholds the values Seam set, which should be on the device, andmodified_toholds the values found on the device. Both are keyed by property:code, orstarts_atandends_at. - For a removed code,
is_access_code_deleted_externallyistrue. - For a deactivated code,
is_access_code_deactivated_externallyistrue.
Codes That Allow External Modifications
When a code allows external modifications, Seam follows what the device has.Confirming a Removal
A code missing from the list a lock provider returns is not proof that it was deleted. Some providers briefly return an incomplete list while the codes are still on the lock. So when a code that allows external modifications goes missing, Seam waits up to one hour before treating it as removed:- While Seam waits, the access code is unchanged: it still reads as set on the device, with no errors, warnings or events. Seam does not program it onto the device again.
- If the provider lists the code again, nothing changes.
- If the code is still missing after the wait, Seam deletes it as described above.
Display Status
While an external modification is in effect, the access code’sdisplay_status shows it:
display_status is for showing to a person only. Do not build logic on it.
Events
If you are moving from
access_code.modified_external_to_seam, access_code.deleted_external_to_seam, the external_modification_in_effect warning, or allow_external_modification, see Migrating to Access Code Lifecycle Events.
See also Lifecycle of Access Codes and Troubleshooting Access Code Issues.