02-24-2025, 04:09 AM
I was thinking about this last night and there may be a way to do it with minimal code overhead: Allow DO to be specified in an IF test. At the moment you can say IF ( DI ) or IF ( AI ), what about adding the ability to say IF ( DO )? Then rule1 can set or reset DO, providing internal state, and rule2 can have DO in the IF test. For example here's how to do ( A OR B ) AND C, as ( DI 1 OR DI 2 ) AND DI 3:
rule1: IF ( DI 1 OR DI 2 ) THEN ( SET DO 1 )
rule2: IF ( DO 1 AND DI 3 ) THEN ( ... )
You can also implement stuff like RS flip-flops and other things with internal state using IFTTT rules, there's just no way to connect one rule to the next one at the moment.
rule1: IF ( DI 1 OR DI 2 ) THEN ( SET DO 1 )
rule2: IF ( DO 1 AND DI 3 ) THEN ( ... )
You can also implement stuff like RS flip-flops and other things with internal state using IFTTT rules, there's just no way to connect one rule to the next one at the moment.