Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExerciseSession is unable to retrieve heart rate data. #134

Open
om1234ww opened this issue Aug 10, 2024 · 3 comments
Open

ExerciseSession is unable to retrieve heart rate data. #134

om1234ww opened this issue Aug 10, 2024 · 3 comments
Labels
Type: question Further information is requested

Comments

@om1234ww
Copy link

om1234ww commented Aug 10, 2024

@matinzd

I want to get heart rate data using the ExerciseSession method, like this:

await  readRecords('ExerciseSession', {
      timeRangeFilter: {
        operator: 'between',
        startTime: '2024-02-01T12:00:00.405Z',
        endTime: '2024-05-04T12:00:00.405Z',
      },
    }).then((result: any) => {
      console.log(":::Ex---"+JSON.stringify(result))
     // data.workout = result[0];
    });
@matinzd matinzd added Type: question Further information is requested and removed Type: bug labels Aug 10, 2024
@matinzd
Copy link
Owner

matinzd commented Aug 10, 2024

Hey!

First of all, you are casting the result to any which is not ideal. Remove any to get the inferred types.
Secondly, HeartRate is a separate entity. There is heart rate data inside ExerciseSession.

export interface ExerciseSessionRecord extends IntervalRecord {

@om1234ww
Copy link
Author

@matinzd How do I retrieve heart rate data within an ExerciseSession?

@matinzd
Copy link
Owner

matinzd commented Aug 10, 2024

I don't know what you mean. But maybe you can check start and the end time of the exercise session and then match it with heart rate data. They are not aggregated together AFAIK. Please investigate this yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants