Private
Public Access
1
0

impeller stuff working, need beta testers

This commit is contained in:
Sander Roosendaal
2021-04-07 11:36:38 +02:00
parent 13af1d3d71
commit 9469fe6200
6 changed files with 75 additions and 9 deletions

View File

@@ -33,6 +33,11 @@ def add_workout_from_data(userid,nkid,data,strokedata,source='nk',splitdata=None
code = uuid4().hex[:16]
)
try:
userid=int(userid)
except TypeError:
userid = userid.id
strokedata.to_csv(csvfilename, index_label='index', compression='gzip')
title = data["name"]
@@ -44,6 +49,7 @@ def add_workout_from_data(userid,nkid,data,strokedata,source='nk',splitdata=None
oarlockSessions = data["oarlockSessions"]
deviceId = data["deviceId"] # you could get the firmware version
summary = get_nk_allstats(data,strokedata)
speedInput = data['speedInput'] # 0 = GPS; 1 = Impeller
@@ -55,11 +61,16 @@ def add_workout_from_data(userid,nkid,data,strokedata,source='nk',splitdata=None
oarLength = oarlocksession["oarLength"] # cm
oarInboardLength = oarlocksession["oarInboardLength"] # cm
seatNumber = oarlocksession["seatNumber"]
try:
oarlockfirmware = oarlocksession["firmwareVersion"]
except KeyError:
oarlockfirmware = ''
else:
boatName = ''
oarLength = 289
oarInboardLength = 88
seatNumber = 1
oarlockfirmware = ''
workouttype = "water"
boattype = "1x"
@@ -75,6 +86,7 @@ def add_workout_from_data(userid,nkid,data,strokedata,source='nk',splitdata=None
'inboard': oarInboardLength/100.,
'oarlength': oarLength/100.,
'summary':summary,
'oarlockfirmware':oarlockfirmware,
}
session = requests.session()