Skip to content

Commit d7cbefb

Browse files
committed
GPS: timestamp seconds value is int.
1 parent a1d7a7a commit d7cbefb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

gps/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ gps = as_GPS.AS_GPS(sreader, fix_cb=callback, cb_mask= as_GPS.RMC | as_GPS.VTG)
189189
`as_GPS.DMY` returns 'DD/MM/YY'.
190190
`as_GPS.LONG` returns a string of form 'January 1st, 2014'.
191191

192-
* `time` No args. Returns the current time in form 'hh:mm:ss.sss'.
192+
* `time` No args. Returns the current time in form 'hh:mm:ss'.
193193

194194
## 2.3 Public coroutines
195195

@@ -266,7 +266,7 @@ The following are counts since instantiation.
266266

267267
As received from most recent GPS message.
268268

269-
* `timestamp` [hrs, mins, secs] e.g. [12, 15, 3.23]
269+
* `timestamp` [hrs, mins, secs] e.g. [12, 15, 3]. Values are integers.
270270
* `date` [day, month, year] e.g. [23, 3, 18]
271271
* `local_offset` Local time offset in hrs as specified to constructor.
272272

gps/as_GPS.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def _set_timestamp(self, utc_string):
233233
if utc_string: # Possible timestamp found
234234
self.timestamp[0] = int(utc_string[0:2]) + self.local_offset # h
235235
self.timestamp[1] = int(utc_string[2:4]) # mins
236-
self.timestamp[2] = float(utc_string[4:]) # secs
236+
self.timestamp[2] = int(utc_string[4:]) # secs
237237

238238
########################################
239239
# Sentence Parsers
@@ -593,7 +593,7 @@ def speed_string(self, unit=KPH):
593593
return sform.format(speed, 'km/h')
594594

595595
def time(self):
596-
return '{:02d}:{:02d}:{:02.3f}'.format(*self.timestamp)
596+
return '{:02d}:{:02d}:{:02d}'.format(*self.timestamp)
597597

598598
def date_string(self, formatting=MDY):
599599
day, month, year = self.date

0 commit comments

Comments
 (0)