From 6a9a996e98271c60ae1b35d76a477d16c85dd89c Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Tue, 26 Jun 2018 16:44:17 +0200 Subject: [PATCH] Add option 0 to command Timers 6.0.0a * Add option 0 to command Timers disarming all timers (#2962) --- sonoff/_releasenotes.ino | 1 + sonoff/xdrv_09_timers.ino | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 71c034780..59cada7e3 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,4 +1,5 @@ /* 6.0.0a + * Add option 0 to command Timers disarming all timers (#2962) * Add time in minutes to rule Time#Initialized, Time#set and Time#Minute (#2669) * Add rule variables %time% for minutes since midnight, %uptime%, %sunrise% and %sunset% giving time in minutes (#2669) * Add heap and stack debug information diff --git a/sonoff/xdrv_09_timers.ino b/sonoff/xdrv_09_timers.ino index 337846efc..1631b5d4d 100644 --- a/sonoff/xdrv_09_timers.ino +++ b/sonoff/xdrv_09_timers.ino @@ -451,6 +451,11 @@ boolean TimerCommand() } } else if (CMND_TIMERS == command_code) { + if (XdrvMailbox.data_len && (XdrvMailbox.payload == 0)) { + for (byte i = 0; i < MAX_TIMERS; i++) { + Settings.timer[i].arm = 0; // Disable all timers + } + } byte jsflg = 0; byte lines = 1; for (byte i = 0; i < MAX_TIMERS; i++) {