[Issue #2] - Added config.py toggle for observing daylight savings time
This commit is contained in:
@@ -5,3 +5,4 @@ WIFI_PASSWORD = "YourPassword" # Set this to your Wi-Fi network password
|
|||||||
# Time settings
|
# Time settings
|
||||||
USE_24_HOUR = False # Set this to True for 24-hour time (no AM/PM)
|
USE_24_HOUR = False # Set this to True for 24-hour time (no AM/PM)
|
||||||
UTC_OFFSET = -5 # Set this to your desired NTP server
|
UTC_OFFSET = -5 # Set this to your desired NTP server
|
||||||
|
DST_OBSERVED = True # Set this to false if you don't observe Daylight Savings Time
|
||||||
|
|||||||
@@ -91,6 +91,9 @@ def is_dst(year, month, day, hour_utc, weekday):
|
|||||||
- Ends: 1st Sunday in November at 02:00 local (06:00 UTC for UTC-4)
|
- Ends: 1st Sunday in November at 02:00 local (06:00 UTC for UTC-4)
|
||||||
Note: weekday is 0=Monday ... 6=Sunday.
|
Note: weekday is 0=Monday ... 6=Sunday.
|
||||||
"""
|
"""
|
||||||
|
if not Config.DST_OBSERVED:
|
||||||
|
return False
|
||||||
|
|
||||||
# 1. Months completely inside or outside DST
|
# 1. Months completely inside or outside DST
|
||||||
if month < 3 or month > 11:
|
if month < 3 or month > 11:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user