python_withings_api icon indicating copy to clipboard operation
python_withings_api copied to clipboard

measure_get_meas() does not return all data

Open gregbodine opened this issue 4 years ago • 3 comments

it looks like commit 02a31649c442b3b1e93e29b3690d6a6d4f385242 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.

gregbodine avatar Oct 14 '21 16:10 gregbodine

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.

msexton187 avatar Feb 27 '22 18:02 msexton187

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...

signebedi avatar Jan 15 '24 01:01 signebedi

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

mattppal avatar Jun 18 '24 23:06 mattppal