diff --git a/esphome/components/sntp/sntp_component.cpp b/esphome/components/sntp/sntp_component.cpp index a6342c2dbb..20e65fdaf3 100644 --- a/esphome/components/sntp/sntp_component.cpp +++ b/esphome/components/sntp/sntp_component.cpp @@ -70,11 +70,12 @@ void SNTPComponent::set_servers(const std::string &server_1, const std::string & } void SNTPComponent::update() { // force resync - if (esp_sntp_enabled()) { #if defined(USE_ESP_IDF) + if (esp_sntp_enabled()) { ESP_LOGD(TAG, "Force resync"); sntp_restart(); #else + if (sntp_enabled()) { sntp_stop(); this->has_time_ = false; sntp_init();