rojabo v2
This commit is contained in:
@@ -172,11 +172,10 @@ a_week_from_now = timezone.now()+timedelta(days=7)
|
||||
def stepsconvert(rojabo_steps, startid = 0, warmup = False, cooldown = False):
|
||||
workout_steps = []
|
||||
for step in rojabo_steps:
|
||||
print(step)
|
||||
durationtype = 'Time'
|
||||
durationvalue = 10
|
||||
if step['duration_type'] == 'seconds':
|
||||
durationvalue = 1000*durationvalue # milliseconds
|
||||
durationvalue = 1000*step['duration_value'] # milliseconds
|
||||
if step['duration_type'] == 'meters':
|
||||
durationtype = 'Distance'
|
||||
durationvalue = step['duration_value']*100 # centimeters
|
||||
@@ -200,6 +199,8 @@ def stepsconvert(rojabo_steps, startid = 0, warmup = False, cooldown = False):
|
||||
if targetvalue is None:
|
||||
targettype = 'Cadence'
|
||||
targetvalue = step['stroke_rate']
|
||||
if targettype == 'Power':
|
||||
targetvalue += 1000
|
||||
|
||||
if step['target_type'] == 'rest':
|
||||
targettype = ''
|
||||
@@ -219,10 +220,11 @@ def stepsconvert(rojabo_steps, startid = 0, warmup = False, cooldown = False):
|
||||
'durationType': durationtype,
|
||||
'durationValue': durationvalue,
|
||||
'targetType': targettype,
|
||||
'targetvalue': targetvalue,
|
||||
'targetValue': targetvalue,
|
||||
'intensity': intensity,
|
||||
'description': description
|
||||
}
|
||||
|
||||
startid += 1
|
||||
workout_steps.append(newstep)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user