Skip to content

Commit a544133

Browse files
Merge pull request #1905 from Neradoc/patch-1
Matrix Portal Moon Clock fix for Circuitpython 7
2 parents 58e230b + ffc68ee commit a544133

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Matrix_Portal_Moon_Clock/code.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ def parse_time(timestring, is_dst=-1):
5252
date_time = timestring.split('T') # Separate into date and time
5353
year_month_day = date_time[0].split('-') # Separate time into Y/M/D
5454
hour_minute_second = date_time[1].split('+')[0].split('-')[0].split(':')
55-
return time.struct_time(int(year_month_day[0]),
55+
return time.struct_time((int(year_month_day[0]),
5656
int(year_month_day[1]),
5757
int(year_month_day[2]),
5858
int(hour_minute_second[0]),
5959
int(hour_minute_second[1]),
6060
int(hour_minute_second[2].split('.')[0]),
61-
-1, -1, is_dst)
61+
-1, -1, is_dst))
6262

6363

6464
def update_time(timezone=None):
@@ -126,14 +126,14 @@ def __init__(self, datetime, hours_ahead, utc_offset):
126126
# Can't change attribute in datetime struct, need to create
127127
# a new one which will roll the date ahead as needed. Convert
128128
# to epoch seconds and back for the offset to work
129-
datetime = time.localtime(time.mktime(time.struct_time(
129+
datetime = time.localtime(time.mktime(time.struct_time((
130130
datetime.tm_year,
131131
datetime.tm_mon,
132132
datetime.tm_mday,
133133
datetime.tm_hour + hours_ahead,
134134
datetime.tm_min,
135135
datetime.tm_sec,
136-
-1, -1, -1)))
136+
-1, -1, -1))))
137137
# strftime() not available here
138138
url = ('https://api.met.no/weatherapi/sunrise/2.0/.json?lat=' +
139139
str(LATITUDE) + '&lon=' + str(LONGITUDE) +

0 commit comments

Comments
 (0)