Question: How can I force a wait time for user inputs in the UI?

Hello

I have a Eufy smart wifi plug that I can toggle on/off through the lovelace UI. The toggle function for my plug works without any issues if I wait for the states to change. However, if i decide to spam the toggle button in the UI, HassIO hangs and i receive this error:

“Updating eufy switch took longer than the scheduled update interval 0:00:clock1030:”

I am certain that spamming the button in the Lovelace UI is what is causing this error and I was wondering if there is a way to force a wait time until the state changes before accepting further inputs.

I thought of creating a script with “wait_template” but I would like to apply this fix to all my switches and creating a script for every switch is not ideal.

That (using an automation and an input boolean) was my first thought. Using an input boolean it will still look like a switch rather than “EXECUTE “.

There’s a problem though.

If an automation or script is in a wait state and the script or automation is run again the wait template exits and execution continues. So this won’t prevent your problem.

I see your point. That would be another reason to avoid scripts in this situation.

Thanks for your input