Skip to content

Commit

Permalink
Add event type to event on treatment notify if it's missing (nightsco…
Browse files Browse the repository at this point in the history
  • Loading branch information
sulkaharo committed Feb 13, 2023
1 parent adc70b7 commit 2795892
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/plugins/treatmentnotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ function init(ctx) {
message = '...';
}

if (!eventType && lastTreatment.carbs && lastTreatment.insulin) eventType = "Meal Bolus";
if (!eventType && lastTreatment.carbs) eventType = "Carb Correction";
if (!eventType && lastTreatment.insulin) eventType = "Correcton Bolus";
if (!eventType) eventType = "Note";

const hash = crypto.createHash('sha1');
const info = JSON.stringify({ eventType, timestamp});
hash.update(info);
Expand Down

0 comments on commit 2795892

Please sign in to comment.