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

Flag manually added data on CalorieHistory & HealthHistory #335

Merged
merged 3 commits into from
Feb 15, 2023

Conversation

sash20m
Copy link
Contributor

@sash20m sash20m commented Jan 11, 2023

This improvement allows methods related to the HeathHistory module and CalorieHistory module to return a key called wasManuallyEntered for each data point received. This tells us if the user has added that data directly in Google Fit ( in which case wasManuallyEntered: true), or if it was recorded with a sensor by a watch, band etc ( in which case wasManuallyEntered: false). This is beneficial for cases when you need to get the actual data ( if you give rewards on workouts or you use it for some sort of competition ).

The methods that will benefit from this are: getDailyCalorieSamples,getHeartRateSamples, getBloodPressureSamples, getBodyTemperatureSamples, getOxygenSaturationSamples, getBloodGlucoseSamples.

A similar issue was reported in #39 , though it's old.

@aboveyunhai aboveyunhai self-requested a review January 12, 2023 21:54
@sash20m sash20m requested a review from aboveyunhai February 13, 2023 20:13
@sash20m
Copy link
Contributor Author

sash20m commented Feb 15, 2023

PS: They categorize data in dataSources (steps, calories, heart etc) and every time the data is added manually, the dataSteamId that the API provides looks like this:

{
      "dataQualityStandard": [], 
      "dataType": {
        "field": [
          {
            "name": "calories", 
            "format": "floatPoint"
          }
        ], 
        "name": "com.google.calories.expended"
      }, 
      "dataStreamName": "user_input", 
      "application": {
        "packageName": "com.google.android.apps.fitness"
      }, 
      "dataStreamId": "raw:com.google.calories.expended:com.google.android.apps.fitness:user_input", 
      "type": "raw"
    }, 

I have been working with their REST API and that's how they send the data. There are other dataStreamIds that do not have the :user_input in them but also represent calories (for this case).

@aboveyunhai
Copy link
Collaborator

PS: They categorize data in dataSources (steps, calories, heart etc) and every time the data is added manually, the dataSteamId that the API provides looks like this:

{
      "dataQualityStandard": [], 
      "dataType": {
        "field": [
          {
            "name": "calories", 
            "format": "floatPoint"
          }
        ], 
        "name": "com.google.calories.expended"
      }, 
      "dataStreamName": "user_input", 
      "application": {
        "packageName": "com.google.android.apps.fitness"
      }, 
      "dataStreamId": "raw:com.google.calories.expended:com.google.android.apps.fitness:user_input", 
      "type": "raw"
    }, 

I have been working with their REST API and that's how they send the data. There are other dataStreamIds that do not have the :user_input in them but also represent calories (for this case).

thx, that's exactly what I was looking for. I just don't know the string is from your own app (that means it only tailors for your app only) or the google fitness side. Will merge the PR shortly.

@aboveyunhai aboveyunhai merged commit f6cce3f into StasDoskalenko:master Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants