From 26252958981b65609a1edf5f77cb213c533c5e4f Mon Sep 17 00:00:00 2001 From: Bart Koolen Date: Mon, 24 Feb 2025 23:11:26 +0100 Subject: [PATCH] Update GlucoseCheck.py Enkele typo's eruit gehaald om te kunnen runnen. --- src/GlucoseCheck.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/GlucoseCheck.py b/src/GlucoseCheck.py index ecb3d92..e19c6da 100644 --- a/src/GlucoseCheck.py +++ b/src/GlucoseCheck.py @@ -96,10 +96,11 @@ def main(url_main, headers_main): print(f"hrs after last bolus: {round(hours_since_last_bolus, 1)}") # linear interpolation of gluc_upper_limit = a[int] + (a[int+1]-a[n]) * frac_part - gluc_upper_limit = limits_table[last_bolus_type][int(hours_since_last_bolus)][0] + - (limits_table[last_bolus_type][int(hours_since_last_bolus+1)][0] - limits_table[last_bolus_type][int(hours_since_last_bolus)][0]) * (hours_since_last_bolus-int(hours_since_last_bolus)) + gluc_upper_limit = limits_table[last_bolus_type][int(hours_since_last_bolus)][0] + \ + (limits_table[last_bolus_type][int(hours_since_last_bolus+1)][0] - limits_table[last_bolus_type][int(hours_since_last_bolus)][0]) \ + * (hours_since_last_bolus-int(hours_since_last_bolus)) if ((gluc_value > gluc_upper_limit) or - (gluc_slope > limits_table[last_bolus_type][hours_since_last_bolus][1])): + (gluc_slope > limits_table[last_bolus_type][int(hours_since_last_bolus)][1])): print("Hey joh check je glucosepeil !") Mqtt.publish(send_topic, f"Hey joh check peil ! (lastbolus -{round(hours_since_last_bolus, 1)})") @@ -145,4 +146,4 @@ Mqtt.connect(broker_address, broker_port, 60) #Set Connection Mqtt.loop_start() #Start connecting if __name__ == "__main__": - main(url, headers) \ No newline at end of file + main(url, headers)