mirror of
https://github.com/esphome/esphome.git
synced 2024-11-27 17:27:59 +01:00
Call sntp_restart if interval changed
This commit is contained in:
parent
15264bce82
commit
39c93ada36
1 changed files with 4 additions and 1 deletions
|
@ -57,7 +57,10 @@ void SNTPComponent::setup() {
|
||||||
ESP_LOGD(TAG, "Set notification callback");
|
ESP_LOGD(TAG, "Set notification callback");
|
||||||
sntp_set_time_sync_notification_cb(sntp_sync_time_cb);
|
sntp_set_time_sync_notification_cb(sntp_sync_time_cb);
|
||||||
|
|
||||||
|
if (sntp_get_sync_interval() != this->get_update_interval()) {
|
||||||
sntp_set_sync_interval(this->get_update_interval());
|
sntp_set_sync_interval(this->get_update_interval());
|
||||||
|
sntp_restart();
|
||||||
|
}
|
||||||
|
|
||||||
// Stop pooler but ler the user update by the hands
|
// Stop pooler but ler the user update by the hands
|
||||||
this->stop_poller();
|
this->stop_poller();
|
||||||
|
|
Loading…
Reference in a new issue