bug fixes
This commit is contained in:
@@ -859,9 +859,18 @@ def step_to_string(step):
|
||||
targettype = None
|
||||
|
||||
if targettype == 'HeartRate':
|
||||
value = step['targetValue']
|
||||
valuelow = step['targetValueLow']
|
||||
valuehigh = step['targetValueHigh']
|
||||
try:
|
||||
value = step['targetValue']
|
||||
except KeyError:
|
||||
value = 0
|
||||
try:
|
||||
valuelow = step['targetValueLow']
|
||||
except KeyError:
|
||||
valuelow = 0
|
||||
try:
|
||||
valuehigh = step['targetValueHigh']
|
||||
except KeyError:
|
||||
valuehigh = 0
|
||||
|
||||
if value < 10 and value>0:
|
||||
target = 'Target: Heart Rate in zone {v}'.format(v=value)
|
||||
@@ -877,9 +886,17 @@ def step_to_string(step):
|
||||
h = valuehigh+100
|
||||
)
|
||||
elif targettype == 'Power':
|
||||
value = step['targetValue']
|
||||
valuelow = step['targetValueLow']
|
||||
valuehigh = step['targetValueHigh']
|
||||
try:
|
||||
value = step['targetValue']
|
||||
except KeyError:
|
||||
value = 0
|
||||
try:
|
||||
valuelow = step['targetValueLow']
|
||||
except KeyError:
|
||||
valuelow = 0
|
||||
try:
|
||||
valuehigh = step['targetValueHigh']
|
||||
except KeyError:
|
||||
|
||||
if value < 10 and value>0:
|
||||
target = 'Target: Power in zone {v}'.format(v=value)
|
||||
@@ -895,9 +912,18 @@ def step_to_string(step):
|
||||
h = valuehigh-1000
|
||||
)
|
||||
elif targettype == 'Speed':
|
||||
value = step['targetValue']
|
||||
valuelow = step['targetValueLow']
|
||||
valuehigh = step['targetValueHigh']
|
||||
try:
|
||||
value = step['targetValue']
|
||||
except KeyError:
|
||||
value = 0
|
||||
try:
|
||||
valuelow = step['targetValueLow']
|
||||
except KeyError:
|
||||
valuelow = 0
|
||||
try:
|
||||
valuehigh = step['targetValueHigh']
|
||||
except KeyError:
|
||||
valuehigh = 0
|
||||
|
||||
if value != 0:
|
||||
v = value/1000.
|
||||
|
||||
Reference in New Issue
Block a user