mirror of
https://github.com/esphome/esphome.git
synced 2025-08-10 12:27:46 +00:00
safe
This commit is contained in:
@@ -102,10 +102,11 @@ void HOT Scheduler::set_timer_common_(Component *component, SchedulerItem::Type
|
|||||||
// Debug logging
|
// Debug logging
|
||||||
const char *type_str = (type == SchedulerItem::TIMEOUT) ? "timeout" : "interval";
|
const char *type_str = (type == SchedulerItem::TIMEOUT) ? "timeout" : "interval";
|
||||||
if (type == SchedulerItem::TIMEOUT) {
|
if (type == SchedulerItem::TIMEOUT) {
|
||||||
ESP_LOGD(TAG, "set_%s(name='%s/%s', %s=%" PRIu32 ")", type_str, item->get_source(), name_cstr, type_str, delay);
|
ESP_LOGD(TAG, "set_%s(name='%s/%s', %s=%" PRIu32 ")", type_str, item->get_source(),
|
||||||
|
name_cstr ? name_cstr : "(null)", type_str, delay);
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGD(TAG, "set_%s(name='%s/%s', %s=%" PRIu32 ", offset=%" PRIu32 ")", type_str, item->get_source(), name_cstr,
|
ESP_LOGD(TAG, "set_%s(name='%s/%s', %s=%" PRIu32 ", offset=%" PRIu32 ")", type_str, item->get_source(),
|
||||||
type_str, delay, static_cast<uint32_t>(item->next_execution_ - now));
|
name_cstr ? name_cstr : "(null)", type_str, delay, static_cast<uint32_t>(item->next_execution_ - now));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -277,8 +278,10 @@ void HOT Scheduler::call() {
|
|||||||
App.set_current_component(item->component);
|
App.set_current_component(item->component);
|
||||||
|
|
||||||
#ifdef ESPHOME_DEBUG_SCHEDULER
|
#ifdef ESPHOME_DEBUG_SCHEDULER
|
||||||
|
const char *item_name = item->get_name();
|
||||||
ESP_LOGV(TAG, "Running %s '%s/%s' with interval=%" PRIu32 " next_execution=%" PRIu64 " (now=%" PRIu64 ")",
|
ESP_LOGV(TAG, "Running %s '%s/%s' with interval=%" PRIu32 " next_execution=%" PRIu64 " (now=%" PRIu64 ")",
|
||||||
item->get_type_str(), item->get_source(), item->get_name(), item->interval, item->next_execution_, now);
|
item->get_type_str(), item->get_source(), item_name ? item_name : "(null)", item->interval,
|
||||||
|
item->next_execution_, now);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Warning: During callback(), a lot of stuff can happen, including:
|
// Warning: During callback(), a lot of stuff can happen, including:
|
||||||
|
Reference in New Issue
Block a user