JonesChi / homebridge-cmdlock

Homebridge plugin for lock via command
Apache License 2.0
7 stars 1 forks source link

changed current to target state #3

Open lejafar opened 6 years ago

lejafar commented 6 years ago

After auto-locking successfully locked my door, the state kept "updating" in the homekit app:

img_251b4a60e09a-1

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.

cpoetter commented 5 years ago

I experience the same behavior. Would be nice if it could be merged!