ESP Homekit SDK: how to update status in iPhone

Hello everybody. I've got esp-homekit-sdk from Espressif and I built the example "lightbulb". It works fine. I can change led status from may Home App.

Now, I want to switch on/off the led also by a mechanical switch. I modified the code for reading a GPIO input connected to this switch. I works, but the iPhone doesn't sense the status changed

How to send the changed status notification to the main task?

Thanks Andrea