mirror of
https://github.com/esphome/esphome.git
synced 2024-11-27 09:18:00 +01:00
Apply suggestions from code review
This commit is contained in:
parent
46b1884fb5
commit
648fdba4f1
1 changed files with 2 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue