Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinebou12 committed Apr 26, 2024
1 parent e28986b commit d96db33
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,8 @@ async def get_measurements(self):
"""
Fetch the most recent weight measurements for the user.
"""
_LOGGER.error(f"test1")
_LOGGER.error(f"{self.get_timestamp()}")
url = f"{API_MEASUREMENTS_URL}?user_id={self.user_id}&last_at={self.get_timestamp()}&locale=en&app_id=Renpho&terminal_user_session_key={self.token}"
try:
parsed = await self._request("GET", url, skip_auth=True)
Expand All @@ -649,6 +651,8 @@ async def get_measurements(self):
_LOGGER.error("No weight measurements found in the response.")
return
if measurements := parsed["last_ary"]:
_LOGGER.error(f"test2")
_LOGGER.error(f"{measurements}")
self.weight_history = [MeasurementDetail(**measurement) for measurement in measurements]
self.weight_info = self.weight_history[0] if self.weight_history else None
self.weight = self.weight_info.weight if self.weight_info else None
Expand Down

0 comments on commit d96db33

Please sign in to comment.