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
1 changed files with 2 additions and 1 deletions

View File

@ -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();