Skip to content

Commit

Permalink
Merge pull request #24 from jasonc-glitch/master
Browse files Browse the repository at this point in the history
Update __init__.py
  • Loading branch information
helto4real authored Jul 21, 2022
2 parents fc64743 + 6b6d942 commit da1ee05
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions custom_components/my_fitnesspal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,15 @@ def update_data_sync(self) -> Dict[str, str]:

result = {}

for meal in info.meals:
meal_name = meal._name.replace(" ", "")
result["meal_" + meal_name + "_calories"] = meal.totals.get("calories")
# result["meal_" + meal_name + "_carbohydrates"] = meal.totals.get("carbohydrates")
# result["meal_" + meal_name + "_protein"] = meal.totals.get("protein")
# result["meal_" + meal_name + "_fat"] = meal.totals.get("fat")
# result["meal_" + meal_name + "_sodium"] = meal.totals.get("sodium")
# result["meal_" + meal_name + "_sugar"] = meal.totals.get("sugar")

result["goal_calories"] = goal_calories
result["goal_kilojoules"] = goal_kilojoules
result["goal_carbohydrates"] = goal_carbohydrates
Expand Down

0 comments on commit da1ee05

Please sign in to comment.