vangorra / python_withings_api

Library for the Withings Health API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

measure_get_meas() does not return all data

gregbodine opened this issue · comments

it looks like commit 02a3164 has changed the defaults for startdate, enddate and lastupdate from None to utcnow(). So, if I you don't provide these optional arguments then you will only get data from today. The only way around this is to set each of these arguments to None in the function call, which does not make much sense. Also startdate and enddate should be mutually exclusive from lastupdate if I read the official doc correctly. with this commit all three are set in the params of the rest call with the default value of utcnow(). When I change these Optional arguments defaults back to None within the code, then things started working again as expected.

I was having the same issue. I couldn't get any measurement data until I updated the code to None as you suggested. Thanks for figuring that out. I would never have found it.

I'll second the above. Explicitly passing None for the lastupdate param when using startdate and enddate fixed this problem for me. Would be worth adding this behavior to a method docstring or comment so future users can solve this problem. Or... revert back the None default value, at least for lastupdate, and set startdate to utcnow - 1 day or something...

commented

+1, this had me puzzled for quite some time. Thanks for posting this issue :)