|
11 | 11 |
|
12 | 12 | # Adafruit IO shared feed key
|
13 | 13 | IO_FEED_KEY = 'location'
|
14 |
| -# Fetch the location every 5 seconds |
15 |
| -SLEEP_DELAY_SECONDS = 5 |
| 14 | +# Fetch the location every 5 minutes |
| 15 | +SLEEP_DELAY_MINUTES = 5 |
16 | 16 | # Set the backlight brightness, 0.0 (off) to 1.0 (max brightness)
|
17 | 17 | BACKLIGHT_BRIGHTNESS = 0.5
|
18 | 18 | # Location text and images
|
|
54 | 54 | group.append(text_area)
|
55 | 55 |
|
56 | 56 | # Draw a label for the location text
|
57 |
| -text_area_location = label.Label(font, text="@ home", color=0x000000, scale=3) |
| 57 | +text_area_location = label.Label(font, text="", color=0x000000, scale=3) |
58 | 58 | text_area_location.x = TEXT_AREA_LOCATION_X
|
59 | 59 | text_area_location.y = TEXT_AREA_LOCATION_Y
|
60 | 60 | group.append(text_area_location)
|
@@ -106,12 +106,12 @@ def set_image(image_group, filename):
|
106 | 106 | else:
|
107 | 107 | print("Location not found in images!")
|
108 | 108 | # Update the location text
|
109 |
| - text_area_location.text="Error: Unknown Value!" |
| 109 | + text_area_location.text="@ unknown" |
110 | 110 | # Show the refreshed group
|
111 | 111 | display.root_group = group
|
112 | 112 | except RuntimeError as e:
|
113 | 113 | print("Failed to fetch location data: ", e)
|
114 | 114 |
|
115 | 115 | # Wait 5 minutes (300 seconds) before fetching the location feed again
|
116 | 116 | print("Sleeping, fetching the location again in 5 minutes!")
|
117 |
| - time.sleep(SLEEP_DELAY_SECONDS * 60) |
| 117 | + time.sleep(SLEEP_DELAY_MINUTES * 60) |
0 commit comments