I am adding a LOCKED state to the Virtual Garage Door (VGD) opener device as part of a future VGD plugin security upgrade. Unfortunately Apple has not provided a LOCKED state in the HomeKit garage door state enumeration. The following minor changes to HLKS v0.6.65 plugin.py will substitute the CLOSED state for the LOCKED state to preserve HKLS/HomeKit functionality.
1. Change line 2029 to
Code: Select all
# doorState: 0 -> open, 1 -> closed, 2 -> opening, 3 -> closing, 4 -> stopped, 5 -> reversing, 6 -> lockedCode: Select all
currentDoorState = (0, 1, 2, 3, 0, 2, 1)[newstate]Code: Select all
targetDoorState = (0, 1, 0, 1, 0, 0, 1)[newstate]Code: Select all
obstructionDetected = (None, 0, None, None, 1, 1, None)[newstate]Code: Select all
doorState = indigodevice.states[stateName] # Get Indigo doorState (0-6)Code: Select all
return (0, 1, 2, 3, 0, 2, 1)[doorState] # Return HomeKit currentDoorState (0-3)I have successfully tested these changes in my home system. Please add them to your next HLKS release. There is no hurry since my VGD security update will probably not be released until the end of July.
Thanks for your help.
David (aka papamac)