Skip to content

Commit 16c3816

Browse files
authored
Merge pull request #2864 from brentru/fix-wheres-my-friend
Fix: Where's my friend
2 parents 1e62b17 + 9470610 commit 16c3816

File tree

1 file changed

+5
-5
lines changed
  • PyPortal/PyPortal_Wheres_My_Friend

1 file changed

+5
-5
lines changed

PyPortal/PyPortal_Wheres_My_Friend/code.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
# Adafruit IO shared feed key
1313
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
1616
# Set the backlight brightness, 0.0 (off) to 1.0 (max brightness)
1717
BACKLIGHT_BRIGHTNESS = 0.5
1818
# Location text and images
@@ -54,7 +54,7 @@
5454
group.append(text_area)
5555

5656
# 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)
5858
text_area_location.x = TEXT_AREA_LOCATION_X
5959
text_area_location.y = TEXT_AREA_LOCATION_Y
6060
group.append(text_area_location)
@@ -106,12 +106,12 @@ def set_image(image_group, filename):
106106
else:
107107
print("Location not found in images!")
108108
# Update the location text
109-
text_area_location.text="Error: Unknown Value!"
109+
text_area_location.text="@ unknown"
110110
# Show the refreshed group
111111
display.root_group = group
112112
except RuntimeError as e:
113113
print("Failed to fetch location data: ", e)
114114

115115
# Wait 5 minutes (300 seconds) before fetching the location feed again
116116
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

Comments
 (0)