From fc3489cfccc31c9f684215ec2559d52c61c77063 Mon Sep 17 00:00:00 2001 From: Alexander Rose Date: Thu, 19 Nov 2020 19:08:41 -0600 Subject: [PATCH] FIX: _get_water now returns cups instead of milliliters like the docs say. --- myfitnesspal/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/myfitnesspal/client.py b/myfitnesspal/client.py index c839eb8..e1cce70 100644 --- a/myfitnesspal/client.py +++ b/myfitnesspal/client.py @@ -642,10 +642,10 @@ def _get_water(self, date: datetime.date) -> float: + "?date={date}".format(date=date.strftime("%Y-%m-%d")) ) value = result.json()["item"]["milliliters"] + cups = int(Volume(ml=value).us_cup) if not self.unit_aware: - return value - - return Volume(ml=value) + return cups + return Volume(us_cup=cups) def __str__(self) -> str: return f"MyFitnessPal Client for {self.effective_username}"