Implement storing of calories expended.
[kraftakt.git] / gfitsync.go
index b7aa36d..beb44d7 100644 (file)
@@ -251,5 +251,9 @@ func handleNotification(ctx context.Context, s *fitbit.Subscription) error {
                return fmt.Errorf("gfitClient.SetSteps(%d) = %v", summary.Summary.Steps, err)
        }
 
+       if err := gfitClient.SetCalories(ctx, summary.Summary.CaloriesOut, tm); err != nil {
+               return fmt.Errorf("gfitClient.SetCalories(%d) = %v", summary.Summary.CaloriesOut, err)
+       }
+
        return nil
 }