Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuleTimer0 applies to all RuleTimers #10352

Merged
merged 2 commits into from
Jan 3, 2021

Conversation

barbudor
Copy link
Contributor

@barbudor barbudor commented Jan 1, 2021

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. (testing if (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:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works on Tasmota core ESP8266 V.2.7.4.9
  • The code change is tested and works on Tasmota core ESP32 V.1.0.5-rc4
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@arendst
Copy link
Owner

arendst commented Jan 2, 2021

Happy to add it to this PR if you want.

Yes pls do.

@barbudor
Copy link
Contributor Author

barbudor commented Jan 2, 2021

Hi, Theo. Done.
Now ruletimers started while no rule is enabled will properly stops at 0.
I also checked with a few test that it doesn't break on time#minute

@arendst arendst merged commit 2f120d8 into arendst:development Jan 3, 2021
arendst added a commit that referenced this pull request Jan 3, 2021
Add command ``RuleTimer0`` to access all RuleTimers at once (#10352)
@barbudor barbudor deleted the dev_ruletimer0 branch January 5, 2021 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants