This commit is contained in:
J. Nick Koston
2025-07-06 10:40:19 -05:00
parent 6bb32c2e61
commit a71030c4de
2 changed files with 10 additions and 7 deletions
+6 -6
View File
@@ -65,13 +65,13 @@ void HOT Scheduler::set_timer_common_(Component *component, SchedulerItem::Type
const char *name_cstr =
is_static_string ? static_cast<const char *>(name_ptr) : static_cast<const std::string *>(name_ptr)->c_str();
// Cancel existing timer if name is not empty
if (name_cstr != nullptr && name_cstr[0] != '\0') {
this->cancel_item_(component, name_cstr, type);
}
if (delay == SCHEDULER_DONT_RUN)
if (delay == SCHEDULER_DONT_RUN) {
// Cancel existing timer if name is not empty
if (name_cstr != nullptr && name_cstr[0] != '\0') {
this->cancel_item_(component, name_cstr, type);
}
return;
}
const auto now = this->millis_();