Skip to content

Commit

Permalink
fix for issue adafruit#2444
Browse files Browse the repository at this point in the history
  • Loading branch information
jdimpson authored Mar 15, 2023
1 parent a2a2916 commit 926e4d7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Star_Fragment_Lamp/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def reset_on_error(delay, error):
def get_request(tries, ping):
for i in range(tries):
try:
n = ping
n = ping()
except Exception as error:
print(error)
time.sleep(10)
Expand All @@ -75,7 +75,7 @@ def get_request(tries, ping):
# get the time on start-up
# pylint: disable=broad-except
try:
now = get_request(5, io.receive_time())
now = get_request(5, io.receive_time)
except Exception as e:
reset_on_error(10, e)
print(now)
Expand All @@ -84,7 +84,7 @@ def get_request(tries, ping):
# function to make a request to open-meteo
def sun_clock():
# make the API request
response = get_request(5, requests.get(weather_url))
response = get_request(5, lambda : requests.get(weather_url))
# packs the response into a JSON
response_as_json = response.json()
# gets sunrise
Expand Down Expand Up @@ -120,7 +120,7 @@ def divide_time(z):

# function that tracks how many hours/minutes until sunrise or sunset
def sun_countdown(sun_event):
n = get_request(5, io.receive_time())
n = get_request(5, io.receive_time)
remaining = time.mktime(sun_event) - time.mktime(n)
r = remaining
# print(remaining)
Expand Down Expand Up @@ -259,7 +259,7 @@ def sun_countdown(sun_event):
# otherwise just keep checking every 15 minutes
# and keep neopixels on
else:
now = get_request(5, io.receive_time())
now = get_request(5, io.receive_time)
print("not looking for sunrise")
print(now)
print()
Expand Down

0 comments on commit 926e4d7

Please sign in to comment.