maximkulkin / esp-homekit

Apple HomeKit accessory server library for ESP-OPEN-RTOS
MIT License
1.11k stars 170 forks source link

A callback when accessoire is ready #36

Closed hn-nguyen closed 5 years ago

hn-nguyen commented 6 years ago

I wonder if there exists some callback to let user know when the accessoire is ready, such as pairing process has been successfully done, ..

This callback is really helpful to initialize other tasks, for example, creating a task to read PIR status, ... These tasks cannot be started at beginning as they will take memory, then, there exists very less memory for homekit paring.

maximkulkin commented 6 years ago

What will you do if user will unpair device? Will your accessory stop doing its primary function until another pairing?

nhnghia commented 6 years ago

Yes, that is a good idea as it’s inutile working without notification to user. In such a case I think that a callback when unpairing is also wanted.

maximkulkin commented 5 years ago

You should be able to track some internal state of homekit through a new event notifications. Check out led_status example.