RuleTimer0 applies to all RuleTimers #10352
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Following request #10338
This implements
RuleTimer0
which applies to all rules timer simultaneously.The major interest is
RuleTimer0 0
to clear all pending rule timers.Independently of this change (already present in older version of Tasmota), I noticed during the test that if no rule is enabled and a RuleTimer is started, RuleTimers do not "stop" at 0 because
RulesEverySecond()
do not process rules nor rules timers. This means if a rule is enabled later on, the RuleTimer may trigger unexpectedly. (testingif (Settings.rule_enabled && !Rules.busy)
This doesn't seems to be a major issue. However a small rewrite, moving the test inside the Timer loop would do the trick.
Happy to add it to this PR if you want.
Checklist:
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass