mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
make NTP arduino3 ready
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#include <NTPSettingsService.h>
|
||||
#include <esp_sntp.h>
|
||||
|
||||
#include "../../src/emsesp_stub.hpp"
|
||||
|
||||
@@ -50,13 +49,13 @@ void NTPSettingsService::configureNTP() {
|
||||
emsesp::EMSESP::system_.ntp_connected(false);
|
||||
if (connected_ && _state.enabled) {
|
||||
emsesp::EMSESP::logger().info("Starting NTP service");
|
||||
sntp_set_sync_interval(3600000); // one hour
|
||||
sntp_set_time_sync_notification_cb(ntp_received);
|
||||
esp_sntp_set_sync_interval(3600000); // one hour
|
||||
esp_sntp_set_time_sync_notification_cb(ntp_received);
|
||||
configTzTime(_state.tzFormat.c_str(), _state.server.c_str());
|
||||
} else {
|
||||
setenv("TZ", _state.tzFormat.c_str(), 1);
|
||||
tzset();
|
||||
sntp_stop();
|
||||
esp_sntp_stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user