File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,10 @@ uint16_t sunsetMaximumBrightness = 0;
1919Ticker fadeTicker;
2020Ticker hasBeenStartedResetTicker;
2121bool hasBeenStarted = false ;
22- ConfigClass *config;
2322
2423void initialize ()
2524{
26- configTime (Config. timeZone * 3600 , Config. summerTime * 3600 , " pool.ntp.org" , " time.nist.gov" );
25+ configTime (0 , 0 , " pool.ntp.org" , " time.nist.gov" );
2726 getSunsetTime ();
2827}
2928
@@ -38,14 +37,15 @@ void handle()
3837 if (!n)
3938 return ;
4039 struct tm *now = gmtime (&n);
40+ int8_t hour = (now->tm_hour + Config.timeZone + Config.summerTime ) % 24 ;
4141
4242 // Check for alarm
43- if (Config.alarmEnabled && now-> tm_hour == Config.alarmHour && now->tm_min == Config.alarmMinute )
43+ if (Config.alarmEnabled && hour == Config.alarmHour && now->tm_min == Config.alarmMinute )
4444 {
4545 Fade::begin (Fade::FadeMode::ALARM);
4646 }
4747 // Check for sunset
48- else if (Config.sunsetEnabled && now-> tm_hour == Config.sunsetHour && now->tm_min == Config.sunsetMinute )
48+ else if (Config.sunsetEnabled && hour == Config.sunsetHour && now->tm_min == Config.sunsetMinute )
4949 {
5050 // Only start sunset if all leds are off
5151 if (FastLEDHub.brightness10 == 0 )
You can’t perform that action at this time.
0 commit comments