From c9af44a92f737b7e8e76c78558b0cbeadc828d91 Mon Sep 17 00:00:00 2001 From: carmichaelong Date: Tue, 11 Jun 2024 16:59:24 -0700 Subject: [PATCH] add info_text entry into results dictionary --- squat_analysis/function/handler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/squat_analysis/function/handler.py b/squat_analysis/function/handler.py index cd8f4bd..1ceca80 100644 --- a/squat_analysis/function/handler.py +++ b/squat_analysis/function/handler.py @@ -90,6 +90,11 @@ def handler(event, context): squat_type = 'Single leg squats (left)' elif eventTypes[0] == 'single_leg_r': squat_type = 'Single leg squats (right)' + + # Pass squat type information into info_text dictionary. + info_text = {} + info_text['squat_type'] = {'label': 'Squat type detected', + 'text': squat_type} # Compute metrics. max_trunk_lean_ground_mean, max_trunk_lean_ground_std, max_trunk_lean_ground_units = squat.compute_trunk_lean_relative_to_ground() @@ -148,7 +153,7 @@ def handler(event, context): 'datasets': datasets, 'x_axis': 'time', 'y_axis': y_axes, - 'squat_type': squat_type} + 'info_text': info_text} return { 'statusCode': 200,