Update GlucoseCheck.py
Enkele typo's eruit gehaald om te kunnen runnen.
This commit is contained in:
parent
153ce6b02e
commit
2625295898
1 changed files with 5 additions and 4 deletions
|
|
@ -96,10 +96,11 @@ def main(url_main, headers_main):
|
||||||
print(f"hrs after last bolus: {round(hours_since_last_bolus, 1)}")
|
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
|
# 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] +
|
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))
|
(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
|
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 !")
|
print("Hey joh check je glucosepeil !")
|
||||||
Mqtt.publish(send_topic, f"Hey joh check peil ! (lastbolus -{round(hours_since_last_bolus, 1)})")
|
Mqtt.publish(send_topic, f"Hey joh check peil ! (lastbolus -{round(hours_since_last_bolus, 1)})")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue