Binary_sensor on_multi_click timings

Could you please explain if and how the order of the timing items in on_multi_click matters?

Are all timings started in parallel?
As soon as one timing sequence matches, its then: section seems to be fired immediately.
But are the other timings that are still in the game processed further?

E.g. looking at the second example at https://esphome.io/components/binary_sensor/index.html#on-multi-click:

Example
on_multi_click:
- timing:
    - ON for at most 1s
    - OFF for at most 1s
    - ON for at most 1s
    - OFF for at least 0.2s
  then:
    - logger.log: "Double Clicked"
- timing:
    - ON for 1s to 2s
    - OFF for at least 0.5s
  then:
    - logger.log: "Single Long Clicked"
- timing:
    - ON for at most 1s
    - OFF for at least 0.5s
  then:
    - logger.log: "Single Short Clicked"

Will pressing the sequence

  • ON 300ms
  • OFF 600ms
  • ON 300ms
  • OFF

… result in firing both a “single short click” after ON-OFF (immediately after 0.5s OFF) and a “double-click” after ON-OFF-ON-OFF (0.2s after the last off)?

Cheers,
–leo

I don’t understand it either.

At first, I thought it would be an automation that would return the number of clicks above 2, so we could know user clicked 3, 8, 15 times, but I think I was wrong.