Skip to content

Commit

Permalink
ntp: use the actual legacy default values
Browse files Browse the repository at this point in the history
  • Loading branch information
mcspr committed Sep 30, 2020
1 parent aec13ce commit fd9f930
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
22 changes: 0 additions & 22 deletions code/espurna/config/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -1596,28 +1596,6 @@
#define NTP_WAIT_FOR_SYNC 1 // Do not report any datetime until NTP sync'ed
#endif

// WARNING: legacy NTP settings. can be ignored with Core 2.6.2+

#ifndef NTP_TIMEOUT
#define NTP_TIMEOUT 1000 // Set NTP request timeout to 2 seconds (issue #452)
#endif

#ifndef NTP_TIME_OFFSET
#define NTP_TIME_OFFSET 60 // Default timezone offset (GMT+1)
#endif

#ifndef NTP_DAY_LIGHT
#define NTP_DAY_LIGHT 1 // Enable daylight time saving by default
#endif

#ifndef NTP_SYNC_INTERVAL
#define NTP_SYNC_INTERVAL 60 // NTP initial check every minute
#endif

#ifndef NTP_DST_REGION
#define NTP_DST_REGION 0 // 0 for Europe, 1 for USA (defined in NtpClientLib)
#endif

// -----------------------------------------------------------------------------
// ALEXA
// -----------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions code/espurna/ntp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ void _ntpConvertLegacyOffsets() {
bool found { false };

bool europe { true };
bool dst { false };
int offset { 0 };
bool dst { true };
int offset { 60 };

settings::kv_store.foreach([&](settings::kvs_type::KeyValueResult&& kv) {
const auto key = kv.key.read();
Expand All @@ -374,7 +374,7 @@ void _ntpConvertLegacyOffsets() {

// XXX: only expect offsets in hours
String custom { europe ? F("CET") : F("CST") };
custom.reserve(16);
custom.reserve(32);

if (offset > 0) {
custom += '-';
Expand Down

0 comments on commit fd9f930

Please sign in to comment.