Zn4rK / php-withings

PSR-FIG Compatible Withings Body metrics Services API written in PHP.
17 stars 14 forks source link

data for calories in activity function showing zero always #22

Closed buddharaj closed 7 years ago

buddharaj commented 7 years ago

Hii, I am using your lib(dev-master branch) for accessing withings API'. To get all activities I am calling $api->getActivity() It gives me proper result except of calories value always to zero. Can you please check and fix. Note:- I am using your unstable version "dev-master", because of dependency support. Please update me soon

Zn4rK commented 7 years ago

Do a print_r($activity); die(); here: https://github.com/Zn4rK/php-withings/blob/master/src/Paxx/Withings/Api.php#L179 and see if you get the calories from the request.

I get calories from getActivity. And also, keep the issues seperate. The other issue you commented on had nothing to do with this.

buddharaj commented 7 years ago

This is the response which I am getting from your master-dev branch.Rest all are fine except calories

`Paxx\Withings\Collection\ActivityCollection Object ( [items:protected] => Array ( [0] => Array ( [date] => 2016-08-21 [steps] => 4199 [distance] => 2883.579 [calories] => 0 [totalcalories] => 1095.191 [elevation] => 0 [soft] => 8584 [moderate] => 0 [intense] => 0 [timezone] => Asia/Kolkata )

    )

)`

buddharaj commented 7 years ago

i am getting for only 22 now... not before that.

Zn4rK commented 7 years ago

I honestly have no idea what you mean. I think you are trying to use getActivity() for getting Intraday Activities - which this library does not implement yet.

The raw response from Withings (as you pasted before) states that calories are 0. I can't change the data you are getting from Withings. If you feel like they are returning wrong data, please contact them for help. I'm not affiliated with Withings.