Closed AlanDThiessen closed 4 years ago
This pull request implements the AutoRelockTime (id 0x0023) of the Zigbee Cluster Library, 7.3.2.13 Operational Settings Attribute Set. This attribute is listed as optionally instrumented by the Door Lock. If the lock does not support this attribute it should respond with an error status of ZCL_INVALID_VALUE (0x87). Do I need to handle that case, or does the Zigbee adapter already handle responses of this nature?
Ideally, we want to determine if the attribute is present before the classifier runs. Currently this is handled in the populateClassifierAttributes function (in zb-adapter.js). Reading attributes is asynchronous, so the general pattern would be something like: if (node looks like a door lock) { sendReadRequest with a callback and a timeout function. } The callback path would set the read-result. Both paths should call the populateClassifierAttributes function again (so each time populateClassifierttributes is called it will do a bit more work).
Then when the classifier is called if won't add a property for the auto-relock time if the attribute isn't supported.
Hopefully that makes sense.
I'm finally getting back to this! This change was made as an opportunity to study the Zigbee adapter and specification in preparation for adding key code entries. I may close this request; but will likely attempt to complete it for the exercise.
Ideally, the zigbee adapter should query this parameter and only add it as a property if the attribute returns successfully.
This should go in the populateClassifierAttributes function in the zb-adapter.js file. It should only try to query if the device looks like a door lock and it supports the appropriate cluster.
Add ability to set the auto relock time on a door lock.