nplan / HomeButtons

135 stars 10 forks source link

quick multiple presses not registered #26

Open csiess85 opened 1 year ago

csiess85 commented 1 year ago

I just realised pressing the buttons very fast ignores the first button press. I have not debugged this, but guess its due to the debounce functionality. Having the possibility to reduce the debounce timeout via mqtt would be great.

nplan commented 1 year ago

The issues is not the debounce timeout.

If ESP32 is in deep sleep, it's woken up on the first press. Then it has to boot up before the second press happens. Boot takes about 60 ms, so that's the limit on how fast in can register multiple presses from deep sleep state. If you put it in awake mode (plug in the USB and turn on Awake mode switch in Home Assistant) it will register shorter multiple presses.

This could be improved by using the wake up stub functionality of the ESP32 but it's not a priority at the moment.

MatthiasLohr commented 1 year ago

Since also stumbled across this (see #9), some improvement here would be nice.