fix crashes from #3146

This commit is contained in:
MichaelDvP
2026-07-12 08:17:40 +02:00
parent 188cc7b666
commit 7ab343a216
2 changed files with 3 additions and 3 deletions

View File

@@ -1800,8 +1800,8 @@ void EMSESP::start() {
LOG_INFO("Library loaded: %d EMS devices, %d device entities, %s", device_library_.size(), EMSESP_TRANSLATION_COUNT, system_.languages_string().c_str()); LOG_INFO("Library loaded: %d EMS devices, %d device entities, %s", device_library_.size(), EMSESP_TRANSLATION_COUNT, system_.languages_string().c_str());
webCustomizationService.begin(); // load the customizations webCustomizationService.begin(); // load the customizations
webSchedulerService.begin(); // load the scheduler events
webCustomEntityService.begin(); // load the custom telegram reads webCustomEntityService.begin(); // load the custom telegram reads
webSchedulerService.begin(); // load the scheduler events
// start telnet service if it's enabled // start telnet service if it's enabled
// default idle is 10 minutes, default write timeout is 0 (automatic) // default idle is 10 minutes, default write timeout is 0 (automatic)

View File

@@ -538,10 +538,10 @@ void WebSchedulerService::loop() {
last_uptime_min = uptime_min; last_uptime_min = uptime_min;
} }
// check calender, sync to RTC, only execute if year is valid // check calender, sync to RTC, only execute if year is valid and uptime more than a minute
time_t now = time(nullptr); time_t now = time(nullptr);
tm * tm = localtime(&now); tm * tm = localtime(&now);
if (tm->tm_min != last_tm_min && tm->tm_year > 120) { if (tm->tm_min != last_tm_min && tm->tm_year > 120 && uuid::get_uptime_sec() > 60) {
// find the real dow and minute from RTC // find the real dow and minute from RTC
uint8_t real_dow = 1 << tm->tm_wday; // 1 is Sunday uint8_t real_dow = 1 << tm->tm_wday; // 1 is Sunday
uint16_t real_min = tm->tm_hour * 60 + tm->tm_min; uint16_t real_min = tm->tm_hour * 60 + tm->tm_min;