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

Access more data from activity #1

Open
GiannosP14 opened this issue Mar 25, 2024 · 5 comments
Open

Access more data from activity #1

GiannosP14 opened this issue Mar 25, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@GiannosP14
Copy link

Hi,

I am wondering how can I access more data from the WithingsMeasureGetActivityData class. For example I can access steps but I cannot modelid or timestamp. Thanks in advance.

@fraca98
Copy link
Owner

fraca98 commented Mar 26, 2024

Hi there,

I'm full these days, so I'll likely have a better chance to dive into this over the weekend.

Regarding the implementation of GetActivity, it's based on the JSON output of this method from the Withings API. In the class parsing the JSON, I followed the example provided in the guide.

However, a couple of considerations:

  • The timestamp might not be necessary since these data are aggregated for a specific day.
  • For the model, it might be worth considering this call, which I still need to implement.

Let me know if there's anything specific I can do to help further.

@GiannosP14
Copy link
Author

Hi,

Thanks for the quick response. I understand your approach and I can see in your class that I cannot get the modelid or the timestamp from the GetActivity even if I modify it (as you mentioned it is based on the API output and those parameters are not there).

When I use the class and print the data I get, I can see other datatypes as well, such as modelid or timestamp, but I am not able to access them. This drives me crazy.

Since I am using you package and not the API directly, I would really appreciate it if you find the time to further help me with this so I can entirely base my logic on your package. Attached is an example of the data I get by using WithingsMeasureGetActivity. Thanks for your time.

Best Regards,
Ioannis

image

@fraca98 fraca98 self-assigned this Mar 26, 2024
@fraca98 fraca98 added the enhancement New feature or request label Mar 26, 2024
fraca98 added a commit that referenced this issue Apr 6, 2024
@fraca98
Copy link
Owner

fraca98 commented Apr 6, 2024

Hi,
it would be nice if you can test a little bit the commit c5ae64b to check some changes i have done, especially in the type of data, cause the documentation of the Withings API is quite poor

@fraca98 fraca98 closed this as completed Apr 6, 2024
@fraca98 fraca98 reopened this Apr 6, 2024
@GiannosP14
Copy link
Author

Hi,

thank you for trying to solve this issue. Could you please elaborate a bit what should I test? Have you included the modelid option to be accessible within Activity class for example (I think yes by using this.status etc, but just to confirm)? Have you updated the package in the pub dev or how can I test it if not? Thanks again.

BR,
Ioannis

@fraca98
Copy link
Owner

fraca98 commented Apr 6, 2024

Yes of course.

  • The Activities class for the file withings_measure_getactivity_data.dart has been modified to include the other elements you provided me

  • This version of is not yet published on pub.dev
    So to use this package version from github follow this guide.
    In your pubspec.yaml file, you should use:

dependencies:
  withings_flutter:
   git:
    url: https://github.com/fraca98/WithingsFlutter.git
    ref: c5ae64b #commit reference id

without importing the package from pub.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants