Make update restart sntp

This commit is contained in:
Anton Sergunov 2024-05-09 07:42:16 +00:00
parent 6d315c6df9
commit e7632ea16c

View file

@ -55,6 +55,7 @@ void SNTPComponent::setup() {
} }
#ifdef USE_ESP_IDF #ifdef USE_ESP_IDF
sntp_set_sync_interval(this->get_update_interval()); sntp_set_sync_interval(this->get_update_interval());
this->stop_poller();
#endif #endif
ESP_LOGD(TAG, "Set notification callback"); ESP_LOGD(TAG, "Set notification callback");
@ -79,6 +80,9 @@ void SNTPComponent::update() {
sntp_init(); sntp_init();
} }
#endif #endif
#if defined(USE_ESP_IDF)
sntp_restart();
#endif
} }
void SNTPComponent::loop() { void SNTPComponent::loop() {
for (const auto &item : callback_args_) { for (const auto &item : callback_args_) {