Apply suggestions from code review

This commit is contained in:
Anton Sergunov 2024-06-10 17:41:22 +06:00 committed by GitHub
parent 46b1884fb5
commit 648fdba4f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,11 +70,12 @@ void SNTPComponent::set_servers(const std::string &server_1, const std::string &
} }
void SNTPComponent::update() { void SNTPComponent::update() {
// force resync // force resync
if (esp_sntp_enabled()) {
#if defined(USE_ESP_IDF) #if defined(USE_ESP_IDF)
if (esp_sntp_enabled()) {
ESP_LOGD(TAG, "Force resync"); ESP_LOGD(TAG, "Force resync");
sntp_restart(); sntp_restart();
#else #else
if (sntp_enabled()) {
sntp_stop(); sntp_stop();
this->has_time_ = false; this->has_time_ = false;
sntp_init(); sntp_init();