Skip to content

Commit dcf558b

Browse files
committed
Fix micropython issue from secs sometimes being a float after remainder operation
1 parent cd71268 commit dcf558b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_gps.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def _parse_gpgga(self, args):
152152
if time_utc is not None:
153153
hours = time_utc // 10000
154154
mins = int((time_utc // 100) % 100)
155-
secs = time_utc % 100
155+
secs = int(time_utc % 100)
156156
# Set or update time to a friendly python time struct.
157157
if self.timestamp_utc is not None:
158158
self.timestamp_utc = time.struct_time((
@@ -188,7 +188,7 @@ def _parse_gprmc(self, args):
188188
if time_utc is not None:
189189
hours = time_utc // 10000
190190
mins = int((time_utc // 100) % 100)
191-
secs = time_utc % 100
191+
secs = int(time_utc % 100)
192192
# Set or update time to a friendly python time struct.
193193
if self.timestamp_utc is not None:
194194
self.timestamp_utc = time.struct_time((

0 commit comments

Comments
 (0)