Patent ID: 8581690

Claim:
An electromechanical lock comprising a generator configured to generate operating power upon the insertion of a key into the lock; a memory configured to store access tables, the access tables comprising information on the keys allowed to open the lock; and an electronic circuitry configured to detect one or more insertions of an associated master key, the insertion of the associated master key initializing a programming mode, store key data of each inserted key into the memory, power down the lock between each insertion of a key; detect the insertions of one or more keys, store key data of each inserted key into the memory, power down the lock between each insertion of a key; and detect the insertion an end function key into the lock, the insertion of the end function key causing the electronic circuitry to read key data from the memory, update the access tables on the basis of the read key data, and cause the lock to exit the programming mode, and power down the lock, wherein the electronic circuitry is configured to determine the access table update depending on the number of master key data items stored in the memory.