So! End goal is that when I have a specific conditioon active, a light should fade between two colors over an interval. The plan for actually making this fade happen is to just send a command to fade to one color for the next 5 seconds every 10 seconds, and then at 5/10 on that interval send a command to fade back to the first color over the remaining 5 seconds.
I know endless automation loops are generally frowned upon and have some issues. Instead, I would like to know which would be a better approach to achieve this effect, given that in both methods a helper or some other boolean will allow dropping the loop (potentially in the form of disabling the automation, but still)
- Endless recursion of the automation
- The automation actually runs once every 5 seconds and determines which state should be transitioned to based on whether the current number of seconds is 0 or evenly divisible by 10
- Two timer helpers?
Not sure which would be preferred here. I used 5 and 10 in this example, but assume I might choose any x and y as long as 2x <= y and a state transition begins every y/2 seconds.