From 619e4bbfb5791491befa66e55961812048df2087 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 3 Jan 2021 17:31:44 +0100 Subject: [PATCH] Add command ``RuleTimer0`` to access all RuleTimers at once Add command ``RuleTimer0`` to access all RuleTimers at once (#10352) --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + tasmota/xdrv_10_rules.ino | 9 +++++---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6637b3a12..8b34c9ca0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. - Command ``VirtualCT`` to simulate or fine tune CT bulbs with 3,4,5 channels (#10311) - Command ``SetOption118 1`` to move ZbReceived from JSON message and into the subtopic replacing "SENSOR" default (#10353) - Command ``SetOption119 1`` to remove the device addr from json payload, can be used with zb_topic_fname where the addr is already known from the topic (#10355) +- Command ``RuleTimer0`` to access all RuleTimers at once (#10352) ### Breaking Changed - Replaced MFRC522 13.56MHz rfid card reader GPIO selection from ``SPI CS`` by ``RC522 CS`` diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 63b7466c3..814272bdf 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -59,6 +59,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota ## Changelog v9.2.0.2 ### Added - Command ``CTRange`` to specify the visible CT range the bulb is capable of [#10311](https://github.com/arendst/Tasmota/issues/10311) +- Command ``RuleTimer0`` to access all RuleTimers at once [#10352](https://github.com/arendst/Tasmota/issues/10352) - Command ``VirtualCT`` to simulate or fine tune CT bulbs with 3,4,5 channels [#10311](https://github.com/arendst/Tasmota/issues/10311) - Command ``SetOption118 1`` to move ZbReceived from JSON message and into the subtopic replacing "SENSOR" default [#10353](https://github.com/arendst/Tasmota/issues/10353) - Command ``SetOption119 1`` to remove the device addr from json payload, can be used with zb_topic_fname where the addr is already known from the topic [#10355](https://github.com/arendst/Tasmota/issues/10355) diff --git a/tasmota/xdrv_10_rules.ino b/tasmota/xdrv_10_rules.ino index 2d0caed1d..637a3b963 100644 --- a/tasmota/xdrv_10_rules.ino +++ b/tasmota/xdrv_10_rules.ino @@ -2124,9 +2124,10 @@ void CmndRule(void) void CmndRuleTimer(void) { - if (XdrvMailbox.index > MAX_RULE_TIMERS) - return; - int i = XdrvMailbox.index, max_i = XdrvMailbox.index; + if (XdrvMailbox.index > MAX_RULE_TIMERS) { return; } + + uint32_t i = XdrvMailbox.index; + uint32_t max_i = XdrvMailbox.index; if (0 == i) { i = 1; max_i = MAX_RULE_TIMERS; @@ -2135,7 +2136,7 @@ void CmndRuleTimer(void) float timer_set = evaluateExpression(XdrvMailbox.data, XdrvMailbox.data_len); timer_set = (timer_set > 0) ? millis() + (1000 * timer_set) : 0; #else - unsigned long timer_set = (XdrvMailbox.payload > 0) ? millis() + (1000 * XdrvMailbox.payload) : 0; + uint32_t timer_set = (XdrvMailbox.payload > 0) ? millis() + (1000 * XdrvMailbox.payload) : 0; #endif // USE_EXPRESSION if (XdrvMailbox.data_len > 0) { for ( ; i <= max_i ; ++i ) {