Update return statement

Much more simple method of only having data in body be joined by commas
and tacking that onto a packet type indicator to avoid having to remove a
comma later. This was suggested in comments on #27.
This commit is contained in:
Bryce Salmi 2017-03-12 23:54:46 -07:00
parent aa3b1bb165
commit e890fe8e3a
1 changed files with 2 additions and 5 deletions

View File

@ -12,7 +12,6 @@ class TelemetryReport(APRSPacket):
tempio = ''.join(self.telemetry['vals'][5])
body = [
'T#', # packet type
str(self.telemetry['seq']).zfill(3),
str(self.telemetry['vals'][0]).zfill(3),
str(self.telemetry['vals'][1]).zfill(3),
@ -22,7 +21,5 @@ class TelemetryReport(APRSPacket):
str(tempio),
self.comment,
]
tmpbody = ",".join(body)
# remove static but erroneous comma between T# and sequenceno
return tmpbody[:2] + tmpbody[3:]
# Add packet type to body joined by commas
return 'T#' + ",".join(body)