Browse Source

check for max #schedules working

rfm69
wysiwyng 6 years ago
parent
commit
29976f99df
1 changed files with 2 additions and 7 deletions
  1. +2
    -7
      code/espurna/scheduler.ino

+ 2
- 7
code/espurna/scheduler.ino View File

@ -18,7 +18,7 @@ Adapted by Xose Pérez <xose dot perez at gmail dot com>
void _schWebSocketOnSend(JsonObject &root){ void _schWebSocketOnSend(JsonObject &root){
root["schVisible"] = 1; root["schVisible"] = 1;
root["maxScheduled"] = SCHEDULER_MAX_SCHEDULES;
root["maxSchedules"] = SCHEDULER_MAX_SCHEDULES;
JsonArray &sch = root.createNestedArray("schedule"); JsonArray &sch = root.createNestedArray("schedule");
for (byte i = 0; i < SCHEDULER_MAX_SCHEDULES; i++) { for (byte i = 0; i < SCHEDULER_MAX_SCHEDULES; i++) {
if (!hasSetting("schSwitch", i)) break; if (!hasSetting("schSwitch", i)) break;
@ -138,7 +138,7 @@ void _schCheck() {
relayStatus(sch_switch, sch_action); relayStatus(sch_switch, sch_action);
} }
} }
DEBUG_MSG_P(PSTR("[SCH] Schedule #%d TRIGGERED!!\n"), sch_switch);
DEBUG_MSG_P(PSTR("[SCH] Schedule #%d TRIGGERED!!\n"), i);
// Show minutes to trigger every 15 minutes // Show minutes to trigger every 15 minutes
// or every minute if less than 15 minutes to scheduled time. // or every minute if less than 15 minutes to scheduled time.
@ -155,13 +155,9 @@ void _schCheck() {
); );
} }
#endif #endif
} }
} }
} }
} }
void _schLoop() { void _schLoop() {
@ -176,7 +172,6 @@ void _schLoop() {
last_minute = current_minute; last_minute = current_minute;
_schCheck(); _schCheck();
} }
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------


Loading…
Cancel
Save