After auto-locking successfully locked my door, the state kept "updating" in the homekit app:
This change fixed it for me! Here's my breakdown:
When button is pressed to unlock, setState is called, lock is false and the TargetState characteristic is Characteristic.LockTargetState.UNSECURED. CurrentState characteristic is correctly set to Characteristic.LockCurrentState.UNSECURED after the unlock_cmd ran.
After the auto_lock_delay the lock_cmd is ran and the CurrentState characteristic is set to Characteristic.LockCurrentState.SECURED, the TargetState characteristic remains Characteristic.LockTargetState.UNSECURED.
This therefore tells HomeKit the lock is busy unlocking.
After auto-locking successfully locked my door, the state kept "updating" in the homekit app:
This change fixed it for me! Here's my breakdown:
When button is pressed to unlock,
setState
is called,lock
isfalse
and the TargetState characteristic isCharacteristic.LockTargetState.UNSECURED
. CurrentState characteristic is correctly set toCharacteristic.LockCurrentState.UNSECURED
after theunlock_cmd
ran.After the
auto_lock_delay
thelock_cmd
is ran and the CurrentState characteristic is set toCharacteristic.LockCurrentState.SECURED
, the TargetState characteristic remainsCharacteristic.LockTargetState.UNSECURED
.This therefore tells HomeKit the lock is busy unlocking.