Giter Club home page Giter Club logo

fitbit_api's People

Contributors

steiley avatar zokioki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fitbit_api's Issues

Unable to call method client.activity_time_series

If i call the method with below params

client.activity_time_series('tracker/steps', {end_date: Date.today, period: "max"})
client.activity_time_series('tracker/steps', end_date: Date.today.iso8601, period: "1d")

i get ArgumentError (unknown keywords: end_date, period)

But if i do
client.activity_time_series('tracker/steps', end_date: Date.today.iso8601, period: "x")

i get FitbitAPI::InvalidArgumentError (Invalid period: "x". Please provide one of the following: ["1d", "7d", "30d", "1w", "1m", "3m", "6m", "1y", "max"].)

I am using ruby 2.5.1

activity_logs_list has stopped working

Hello. Thanks for this Gem. I've used it in production for many years and it's been great.

In the last few weeks, we ran into an issue with activity_logs_list.

It seems that FitBit's API will now break if an empty afterDate is passed in with a beforeDate. I am presuming that before FitBit silently ignored an empty afterDate but now it raises a 400 with a bad argument.

I think the solution is to just strip empty args when making API calls. But I'm not sure enough of how you'd want to solve this to make a PR. I figure it's easier for you to do.

I've monkeypatched the method locally to just not have afterDate as a default param and things now work again for my usecase.

Thanks!

#activity_logs_list API call returns with error

When calling #activity_logs_list, the response returned states that beforeDate or afterDate fields are missing:

{"errors": [{"errorType": "validation", "fieldName": "date", "message": "beforeDate or afterDate is required" }]}

undefined method 'expired?' for nil:NilClass

In my callback method I have the following:

@client.get_token(params[:code])
redirect_to dashboard_path

And then on the Dashboard I have:

@devices = @client.devices

However it returns the error: undefined method 'expired?' for nil:NilClass

Looking into your gem code it looks like because the @token is nil it's what's causing the error when it's trying to check if it's expired. Because it hasn't been set.

However when debugging I am in fact getting a correct return from Fitbit so the tokens, etc are all being returned so that instance variable should of been set. I vendorized the gem and tried to debug it using Visual Studio code like so:

image

And what I'm finding is that @token is being set fine. But when it hits the second breakpoint it's nil causing the issue. Why is the instance variable losing the data?

Persistent storage for access and refresh tokens

Hello,

Many thanks for your work on this gem - it's been very easy to use! I'm just having one problem.

I'm using the gem in a command-line application, and currently, I am having to go through the oauth authentication again quite frequently - at least daily.

I think this is because the original tokens are expiring and I'm not using the most recent tokens for subsequent runs, as they are not currently stored persistently.

Unfortunately I can't see an easy way to do this - have I missed something? Is there a way to have the gem call back or something so that I can store new access and refresh tokens for subsequent runs?

Cheers!

Parse error on #delete_favorite_activity

When delete_favorite_activity is called, the given activity is successfully removed from the user's favorites list, but on response MultiJson throws a MultiJson::ParseError.

Fitbit's docs show that the expected result is an empty response body with a 204 status - such a response appears to pass when other methods are called.

Example ID to pass into method's argument: 90004

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.