Git Product home page Git Product logo

Comments (10)

ericzinnikas avatar ericzinnikas commented on August 17, 2024 1

See my comment above, it is line 354 now (the "projectNumber," line).

from fitbit-googlefit.

ericzinnikas avatar ericzinnikas commented on August 17, 2024

I had some success manually deleting the DataSource (works on next run after this):

curl --header "Authorization: Bearer ya29.SECRETHERE" -X DELETE \ 
--header "Content-Type: application/json;encoding=utf-8"  \ 
"https://www.googleapis.com/fitness/v1/users/me/dataSources/raw:com.google.body.fat.percentage:fitbit:aria:io.pkp.fbit-gfit"

But then I'm running into errors about:

googleapiclient.errors.HttpError: <HttpError 400 when requesting https://www.googleapis.com/fitness/v1/users/me/dataSources/raw%3Acom.google.weight%3AXXXXXXXX%3Afitbit%3Aaria%3Aio.pkp.fbit-gfit/datasets/1519720264000000000-1519720264000000110?alt=json returned "Unable to fetch DataSource for Dataset: raw:com.google.weight:312047935529:fitbit:aria:io.pkp.fbit-gfit">

Though if I manually issue the curl request, it completes successfully. So either Google's API is having issues or the python wrapper is buggy it would seem? I'm not sure.

from fitbit-googlefit.

ericzinnikas avatar ericzinnikas commented on August 17, 2024

Alright, after a bunch more debugging... open up convertors.py and comment out line 355:

- projectNumber,
+ #projectNumber,

Looking at Google Fit on my phone after, I can see that weight definitely has synced (that's the only one I tried).

from fitbit-googlefit.

ericzinnikas avatar ericzinnikas commented on August 17, 2024

No idea why this works... their API docs seem to say this should not work, but it obviously does.

from fitbit-googlefit.

pkpio avatar pkpio commented on August 17, 2024

@ericzinnikas Thanks for digging in. Sorry, I didn't get a chance to look into this lately. I will find a proper fix when I revisit the project.

from fitbit-googlefit.

davinkevin avatar davinkevin commented on August 17, 2024

Thx for the help, I will try that as soon as possible !

from fitbit-googlefit.

davinkevin avatar davinkevin commented on August 17, 2024

This totally solves the problem without even delete the previous element

from fitbit-googlefit.

mollerhansen avatar mollerhansen commented on August 17, 2024

my line 355 in converters.py are:
dataSource['device']['manufacturer'],

But I am getting the same error, any good suggestions?

from fitbit-googlefit.

tvdsluijs avatar tvdsluijs commented on August 17, 2024

I've got the same error.

Traceback (most recent call last):
  File "/Users/theovandersluijs/PycharmProjects/fitbit-googlefit/remote.py", line 122, in CreateGoogleFitDataSource
    dataSourceId=self.convertor.GetDataSourceId(dataType)).execute()
  File "/Users/theovandersluijs/PycharmProjects/fitbitenv/lib/python3.6/site-packages/oauth2client/util.py", line 137, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/Users/theovandersluijs/PycharmProjects/fitbitenv/lib/python3.6/site-packages/googleapiclient/http.py", line 840, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 404 when requesting https://www.googleapis.com/fitness/v1/users/me/dataSources/raw%3Acom.google.step_count.delta%3A984249661236%3Afitbit%3Acharge-hr%3Aio.pkp.fbit-gfit?alt=json returned "DataSourceId not found: raw:com.google.step_count.delta:984249661236:fitbit:charge-hr:io.pkp.fbit-gfit">

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "app.py", line 110, in <module>
    main()
  File "app.py", line 60, in main
    remote.CreateGoogleFitDataSource(dataType)
  File "/Users/theovandersluijs/PycharmProjects/fitbit-googlefit/remote.py", line 129, in CreateGoogleFitDataSource
    body=self.convertor.GetDataSource(dataType)).execute()
  File "/Users/theovandersluijs/PycharmProjects/fitbitenv/lib/python3.6/site-packages/oauth2client/util.py", line 137, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/Users/theovandersluijs/PycharmProjects/fitbitenv/lib/python3.6/site-packages/googleapiclient/http.py", line 840, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 409 when requesting https://www.googleapis.com/fitness/v1/users/me/dataSources?alt=json returned "Data Source: raw:com.google.step_count.delta:fitbit:charge-hr:io.pkp.fbit-gfit already exists">

from fitbit-googlefit.

pkpio avatar pkpio commented on August 17, 2024

Resolved in #58

from fitbit-googlefit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.