Private
Public Access
1
0

rojabo v2

This commit is contained in:
Sander Roosendaal
2022-11-01 18:36:08 +01:00
parent cd8a0456c8
commit 055725eef9
6 changed files with 85 additions and 8 deletions

View File

@@ -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)