Skip to content

Commit

Permalink
gps: remove datetime object, problem with serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
tajgr committed Jun 19, 2024
1 parent 77eeb64 commit a7a4008
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions osgar/drivers/gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from threading import Thread
import struct
from datetime import datetime

from osgar.bus import BusShutdownException

Expand Down Expand Up @@ -52,7 +51,7 @@ def parse_nmea(line):
nmea_data["lon_dir"] = None if nmea_list[5] == "" else nmea_list[5]
nmea_data["lat"] = None if nmea_list[2] == "" else str2deg(nmea_list[2])
nmea_data["lat_dir"] = None if nmea_list[3] == "" else nmea_list[3]
nmea_data["utc_time"] = None if nmea_list[1] == "" else datetime.strptime(nmea_list[1], "%H%M%S.%f").time()
nmea_data["utc_time"] = None if nmea_list[1] == "" else nmea_list[1] # format: "%H%M%S.%f"
nmea_data["quality"] = None if nmea_list[6] == "" else int(nmea_list[6])
nmea_data["sats"] = None if nmea_list[7] == "" else int(nmea_list[7])
nmea_data["hdop"] = None if nmea_list[8] == "" else float(nmea_list[8])
Expand Down

0 comments on commit a7a4008

Please sign in to comment.