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

client.get_measurements(measurement='Weight') Error (ValueError: Measurement 'Weight' does not exist.) #162

Open
johnhillescobar opened this issue Jun 2, 2023 · 3 comments

Comments

@johnhillescobar
Copy link

johnhillescobar commented Jun 2, 2023

Hi team,

I am still getting an error from the get_measurements function. I cannot get my weight from there.

This is the error I am getting:

-----------------------------------------------------------------
ValueError                      Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_28780\1855173169.py in <module>
----> 1 client.get_measurements(measurement='Weight')

~\anaconda3\lib\site-packages\myfitnesspal\client.py in get_measurements(self, measurement, lower_bound, upper_bound)
    535             measurement_id = measurement_ids[measurement]
    536         else:
--> 537             raise ValueError(f"Measurement '{measurement}' does not exist.")
    538 
    539         page = 1

ValueError: Measurement 'Weight' does not exist.

I am properly getting data when using other functions. For example:

nutrition_activity = client.get_date(2023, 5, 25)

nutrition_activity.exercises[1].get_as_list()

>>> [{'name': 'Lateral Pull',
          'nutrition_information': {'sets': 5.0,
           'reps/set': 10.0,
           'weight/set': 120.0}}]

All the support is highly appreciated!

@hannahburkhardt
Copy link
Collaborator

could you use my branch where I fixed the issue and let me know if you’re still getting the issue there? It hasn’t been merged yet because @coddingtonbear has not had a chance to review.

@johnhillescobar
Copy link
Author

Let me test it!

@hlipnick
Copy link

hlipnick commented Sep 19, 2023

Is there anything I can help with that would get this change merged into the main branch? Would be great to have this working again.

Nevermind - realize that Hannah's change was merged, there just hasn't been a release since then so the version pulled from pip doesn't have that change. For anyone in the future (including myself), this will do the trick:

pip install git+https://github.com/coddingtonbear/python-myfitnesspal.git

Thanks!

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

No branches or pull requests

3 participants