maximkulkin / esp-homekit-demo

Demo of Apple HomeKit accessory server library
MIT License
803 stars 233 forks source link

Question: Ready Event? #406

Open jpasqua opened 3 years ago

jpasqua commented 3 years ago

Sorry if this is obvious, but I haven't found a way to know when the device is "ready". For example, in the button example, after the device boots, after a short period of time button presses will be acknowledged in the monitor when the associated printf("single press\n"); is executed. However, no configured action will take place (e.g. turning on a light). After a longer period of time elapses, a button press will actually trigger the associated action. In the mean time a variety of events have occurred:; e.g.:

>>> HomeKit: [Client 6] Update Characteristics
>>> HomeKit: [Client 6] Get Characteristics
>>> HomeKit: [Client 4] Update Characteristics
>>> HomeKit: [Client 4] Update Characteristics
>>> HomeKit: [Client 6] Update Characteristics
>>> HomeKit: Got new client connection: 4 from 192.168.1.155
>>> HomeKit: [Client 4] Pair Verify Step 1/2
>>> HomeKit: [Client 4] Pair Verify Step 2/2
>>> HomeKit: [Client 4] Found pairing with A5EB9C70-54E5-475E-A124-336E45AACF07
>>> HomeKit: [Client 4] Verification successful, secure session established
>>> HomeKit: [Client 4] Get Accessories
>>> HomeKit: Got new client connection: 5 from 192.168.1.128
...

My question is, is there some callback or state that the button code can use to determine that presses will now be acted upon? I have registered a homekit_event_handler callback, but none of those events seems to be definitive.

TIA