Skip to content

Commit

Permalink
WLED time overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
blazoncek committed Jan 13, 2024
1 parent 97889b5 commit 874b24f
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

// version code in format yymmddb (b = daily build)
#define VERSION 2401110
#define VERSION 2401130

//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG
Expand Down Expand Up @@ -475,10 +475,19 @@ WLED_GLOBAL char last_signal_src[13] _INIT(""); // last seen ESP-NOW sender
#endif

// Time CONFIG
WLED_GLOBAL bool ntpEnabled _INIT(false); // get internet time. Only required if you use clock overlays or time-activated macros
WLED_GLOBAL bool useAMPM _INIT(false); // 12h/24h clock format
WLED_GLOBAL byte currentTimezone _INIT(0); // Timezone ID. Refer to timezones array in wled10_ntp.ino
WLED_GLOBAL int utcOffsetSecs _INIT(0); // Seconds to offset from UTC before timzone calculation
#ifndef WLED_NTP_ENABLED
#define WLED_NTP_ENABLED false
#endif
#ifndef WLED_TIMEZONE
#define WLED_TIMEZONE 0
#endif
#ifndef WLED_UTC_OFFSET
#define WLED_UTC_OFFSET 0
#endif
WLED_GLOBAL bool ntpEnabled _INIT(WLED_NTP_ENABLED); // get internet time. Only required if you use clock overlays or time-activated macros
WLED_GLOBAL bool useAMPM _INIT(false); // 12h/24h clock format
WLED_GLOBAL byte currentTimezone _INIT(WLED_TIMEZONE); // Timezone ID. Refer to timezones array in wled10_ntp.ino
WLED_GLOBAL int utcOffsetSecs _INIT(WLED_UTC_OFFSET); // Seconds to offset from UTC before timzone calculation

WLED_GLOBAL byte overlayCurrent _INIT(0); // 0: no overlay 1: analog clock 2: was single-digit clock 3: was cronixie
WLED_GLOBAL byte overlayMin _INIT(0), overlayMax _INIT(DEFAULT_LED_COUNT - 1); // boundaries of overlay mode
Expand Down Expand Up @@ -650,15 +659,21 @@ WLED_GLOBAL String escapedMac;
WLED_GLOBAL DNSServer dnsServer;

// network time
#ifndef WLED_LAT
#define WLED_LAT 0.0f
#endif
#ifndef WLED_LON
#define WLED_LON 0.0f
#endif
WLED_GLOBAL bool ntpConnected _INIT(false);
WLED_GLOBAL time_t localTime _INIT(0);
WLED_GLOBAL unsigned long ntpLastSyncTime _INIT(999000000L);
WLED_GLOBAL unsigned long ntpPacketSentTime _INIT(999000000L);
WLED_GLOBAL IPAddress ntpServerIP;
WLED_GLOBAL uint16_t ntpLocalPort _INIT(2390);
WLED_GLOBAL uint16_t rolloverMillis _INIT(0);
WLED_GLOBAL float longitude _INIT(0.0);
WLED_GLOBAL float latitude _INIT(0.0);
WLED_GLOBAL float longitude _INIT(WLED_LON);
WLED_GLOBAL float latitude _INIT(WLED_LAT);
WLED_GLOBAL time_t sunrise _INIT(0);
WLED_GLOBAL time_t sunset _INIT(0);
WLED_GLOBAL Toki toki _INIT(Toki());
Expand Down

0 comments on commit 874b24f

Please sign in to comment.