|
16 | 16 | from adafruit_ticks import ticks_ms, ticks_add, ticks_diff |
17 | 17 |
|
18 | 18 | ## See TZ Identifier column at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones |
19 | | -## If you want to set the timezone, you can do so with the following line: |
20 | | -timezone = "GB" # Set timezone for UK developers ;) |
| 19 | +## If you want to set the timezone, you can do so with the following: |
| 20 | +timezone = os.getenv("ADAFRUIT_AIO_TIMEZONE", "America/New_York") # Fetch timezone from settings.toml or default to EST |
21 | 21 | # timezone = None # Or instead rely on automatic timezone detection based on IP Address |
22 | 22 |
|
23 | 23 |
|
24 | 24 | ## The time of the thing! |
25 | 25 | EVENT_YEAR = 2024 |
26 | 26 | EVENT_MONTH = 8 |
27 | | -EVENT_DAY = 11 # 16 |
28 | | -EVENT_HOUR = 10 # 0 |
29 | | -EVENT_MINUTE = 28 # 0 |
| 27 | +EVENT_DAY = 16 |
| 28 | +EVENT_HOUR = 0 |
| 29 | +EVENT_MINUTE = 0 |
30 | 30 | ## we'll make a python-friendly structure |
31 | 31 | event_time = time.struct_time( |
32 | 32 | ( |
|
82 | 82 | PIXEL_SHADER = blinka_bitmap.pixel_shader |
83 | 83 | group = displayio.Group() |
84 | 84 | font = bitmap_font.load_font(FONT_FILE) |
85 | | -# blinka_bitmap = displayio.OnDiskBitmap(BITMAP_FILE) |
86 | 85 | blinka_grid = displayio.TileGrid(blinka_bitmap, pixel_shader=blinka_bitmap.pixel_shader) |
87 | | -# blinka_grid.y = -100 |
88 | 86 | scrolling_label = bitmap_label.Label(font, text=" ", y=display.height - FONT_Y_OFFSET) |
89 | 87 |
|
90 | 88 | group.append(blinka_grid) |
|
156 | 154 | remaining //= 24 |
157 | 155 | days_remaining = remaining |
158 | 156 | if not finished or (finished and days_remaining < 0): |
159 | | - # Remove 1 from days_remaining to count from end of day instead of start |
| 157 | + # Add 1 to negative days_remaining to count from end of day instead of start |
160 | 158 | if days_remaining < 0: |
161 | | - print( |
162 | | - f"Event time in past: Adding 1 to days_remaining ({days_remaining}) to count from end of day" |
163 | | - ) |
164 | 159 | days_remaining += 1 |
165 | 160 | # Update the display with current countdown value |
166 | 161 | scrolling_label.text = ( |
|
0 commit comments