Improving multiple, nested if-then-else statements

Oooohhh - Finite State Machine (FSM) - the love of my life.
I think you might be right - the code lends itself to being coded as an FSM (either using pure JavaScript or the Node-RED FSM node).

1 Like