Skip to content

Missing "custom_target_value_low" field for "heart_rate" target_type #5

@hesselbom

Description

@hesselbom

First of all, thanks for a great lib. Most things are working great but found an issue.

The issue

I'm importing a structured workout .fit file where a workout step has target_type: "heart_rate" and a "custom_target_value_low"=240 & custom_target_value_high="260".

When viewing the file through https://www.fitfileviewer.com/ it shows these fields.
Screenshot 2023-01-13 at 14 37 42

In the README.md of this project it recommends FIT File Explorer, and when using that tool it also shows these fields, but named custom_target_heart_rate_high, which actually might be more correct when looking at documentation (https://developer.garmin.com/fit/file-types/workout/#targettype).
Screenshot 2023-01-13 at 14 41 58

But when using this lib, FitFileParser, they are not included. Instead there's a target_hr_zone with a value of 0.
Screenshot 2023-01-13 at 14 37 50

Steps to reproduce

  1. Create a new swift project
  2. Write the following code:
        if let fit = FitFile(file: selectedFile) {
            let steps = fit.messages(forMessageType: .workout_step)
            for step in steps {
                print(step.interpretedFieldKeys())
            }
        }
  1. Use the attached .fit file and run
  2. Notice the output is:
["target_hr_zone", "duration_time", "intensity", "message_index_value", "target_type", "duration_type", "wkt_step_name", "message_index"]
["message_index_value", "duration_type", "intensity", "message_index"]

Expected to happen

The output should include the custom_target_value_low/custom_target_heart_rate_low and custom_target_value_high/custom_target_heart_rate_high fields.

.fit file I use

2023-01-13_heartratef.fit.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions