Skip to content

Commit

Permalink
Merge pull request #11 from cleinias/MissingMaxSpeedFix
Browse files Browse the repository at this point in the history
Added conditions to skip attempted conversions of MaxSpeed and TotalT…
  • Loading branch information
Tigge committed Jan 30, 2020
2 parents f8525b4 + 0c15335 commit 5a36eaf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fittotcx/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ def add_lap(element, activity, lap):
end_time = lap.get_value("timestamp")

totaltime = lap.get_value("total_elapsed_time")
if totaltime is None:
totaltime = lap.get_value("")
distance = lap.get_value("total_distance")
max_speed = lap.get_value("max_speed") # opt
calories = lap.get_value("total_calories")
Expand All @@ -178,7 +180,8 @@ def add_lap(element, activity, lap):

create_sub_element(lapelem, "TotalTimeSeconds", ff(totaltime))
create_sub_element(lapelem, "DistanceMeters", ff(distance))
create_sub_element(lapelem, "MaximumSpeed", ff(max_speed))
if max_speed is not None:
create_sub_element(lapelem, "MaximumSpeed", ff(max_speed))
create_sub_element(lapelem, "Calories", ff(calories))
# create_sub_element(lapelem, "AverageHeartRateBpm", avg_heart)
# create_sub_element(lapelem, "MaximumHeartRateBpm", max_heart)
Expand Down

0 comments on commit 5a36eaf

Please sign in to comment.