mirror of
https://github.com/esphome/esphome.git
synced 2024-11-24 07:58:09 +01:00
Enable pooler
This commit is contained in:
parent
adcb11aae3
commit
51c66f8485
1 changed files with 11 additions and 2 deletions
|
@ -58,7 +58,6 @@ void SNTPComponent::setup() {
|
||||||
sntp_set_time_sync_notification_cb(sntp_sync_time_cb);
|
sntp_set_time_sync_notification_cb(sntp_sync_time_cb);
|
||||||
|
|
||||||
sntp_set_sync_interval(this->get_update_interval());
|
sntp_set_sync_interval(this->get_update_interval());
|
||||||
this->stop_poller();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sntp_init();
|
sntp_init();
|
||||||
|
@ -72,7 +71,16 @@ void SNTPComponent::dump_config() {
|
||||||
ESP_LOGCONFIG(TAG, " Timezone: '%s'", this->timezone_.c_str());
|
ESP_LOGCONFIG(TAG, " Timezone: '%s'", this->timezone_.c_str());
|
||||||
}
|
}
|
||||||
void SNTPComponent::update() {
|
void SNTPComponent::update() {
|
||||||
#if !defined(USE_ESP_IDF) && !defined(USE_HOST)
|
#if !defined(USE_HOST)
|
||||||
|
#if defined(USE_ESP_IDF)
|
||||||
|
if (sntp_enabled()) {
|
||||||
|
ESP_LOGD(TAG, "Reset SNTP");
|
||||||
|
this->has_time_ = false;
|
||||||
|
sntp_reset();
|
||||||
|
} else {
|
||||||
|
ESP_LOGD(TAG, "SNTP is not enabled");
|
||||||
|
}
|
||||||
|
#else
|
||||||
// force resync
|
// force resync
|
||||||
if (sntp_enabled()) {
|
if (sntp_enabled()) {
|
||||||
sntp_stop();
|
sntp_stop();
|
||||||
|
@ -80,6 +88,7 @@ void SNTPComponent::update() {
|
||||||
sntp_init();
|
sntp_init();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void SNTPComponent::loop() {
|
void SNTPComponent::loop() {
|
||||||
#if defined(USE_ESP_IDF)
|
#if defined(USE_ESP_IDF)
|
||||||
|
|
Loading…
Reference in a new issue