From 7c31bedc9b2ea039119e0ee5bba10fe995d46d0a Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Tue, 2 Apr 2019 10:35:19 +0200
Subject: [PATCH] Fix Configure Timer Gui webinterface (#5568)
Fix Configure Timer Gui webinterface (#5568)
---
sonoff/xdrv_09_timers.ino | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sonoff/xdrv_09_timers.ino b/sonoff/xdrv_09_timers.ino
index 05e931254..2f11421dc 100644
--- a/sonoff/xdrv_09_timers.ino
+++ b/sonoff/xdrv_09_timers.ino
@@ -620,7 +620,7 @@ const char HTTP_TIMER_SCRIPT5[] PROGMEM =
"function it(){" // Initialize elements and select first tab
"var b,i,o,s;"
"pt=eb('t0').value.split(',').map(Number);" // Get parameters from hidden area to array
- "s='';for(i=0;i<" STR(MAX_TIMERS) ";i++){b='';if(0==i){b=\" id='dP'\";}s+=\"\"}"
+ "s='';for(i=0;i<%d;i++){b='';if(0==i){b=\" id='dP'\";}s+=\"\"}"
"eb('bt').innerHTML=s;" // Create tabs
"if(%d>0){" // Create Output and Action drop down boxes
"eb('oa').innerHTML=\"" D_TIMER_OUTPUT " " D_TIMER_ACTION " \";"
@@ -705,7 +705,7 @@ void HandleTimerConfiguration(void)
#endif // USE_SUNRISE
WSContentSend_P(HTTP_TIMER_SCRIPT3, devices_present);
WSContentSend_P(HTTP_TIMER_SCRIPT4, devices_present);
- WSContentSend_P(HTTP_TIMER_SCRIPT5, devices_present);
+ WSContentSend_P(HTTP_TIMER_SCRIPT5, MAX_TIMERS, devices_present);
WSContentSend_P(HTTP_TIMER_SCRIPT6, devices_present);
WSContentSendStyle_P(HTTP_TIMER_STYLE);
WSContentSend_P(HTTP_FORM_TIMER1, (Settings.flag3.timers_enable) ? " checked" : "");