So the trick is that the “hold” action depends on the previous action and the fact that the “hold” action is triggered within one second after a “click” or another “hold”
I think I need some helpers:
a timer to detect the “1 second”
a toggle that defines the active action
Is this possible?
Can somebody provide me with a sample code?
Example of detecting a Hue dimmer switch’s ‘long_release’ event immediately after an ‘initial_press’ event.
The automation listens for ‘initial_press’ event then uses a wait_for_trigger to listen for a 'long_release` event (but it doesn’t wait for longer than 2 seconds).
But…
the script will be triggerd if you have a long_release within 2 secs after a initial_press, right?
what I want to achieve is
immediate action on “long press” (brightness up)
and the kind of action will change if this “long press” is initiated within a period of 1 second after another action (brightness down, colortemp up/down, hue up/down, …)
In fact I want to imitate the default behavior of a single butoon you can find in a lot of meeting rooms, f and where you can toggle light and dim up/down with only two actions: click and hold