mirror of
https://github.com/esphome/esphome.git
synced 2024-09-27 04:03:30 +02:00
Apply suggestions from code review
This commit is contained in:
parent
46b1884fb5
commit
648fdba4f1
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user