mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
allow multiple onChange schedules with same trigger #1806
This commit is contained in:
@@ -371,16 +371,17 @@ bool WebSchedulerService::command(const char * cmd, const char * data) {
|
||||
#include "shuntingYard.hpp"
|
||||
|
||||
bool WebSchedulerService::onChange(const char * cmd) {
|
||||
bool cmd_ok = false;
|
||||
for (const ScheduleItem & scheduleItem : *scheduleItems_) {
|
||||
if (scheduleItem.active && scheduleItem.flags == SCHEDULEFLAG_SCHEDULE_ONCHANGE
|
||||
&& Helpers::toLower(scheduleItem.time).find(Helpers::toLower(cmd)) != std::string::npos) {
|
||||
#ifdef EMESESP_DEBUG
|
||||
// emsesp::EMSESP::logger().debug(scheduleItem.cmd.c_str());
|
||||
#endif
|
||||
return command(scheduleItem.cmd.c_str(), compute(scheduleItem.value).c_str());
|
||||
cmd_ok |= command(scheduleItem.cmd.c_str(), compute(scheduleItem.value).c_str());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return cmd_ok;
|
||||
}
|
||||
|
||||
void WebSchedulerService::condition() {
|
||||
|
||||
Reference in New Issue
Block a user