From 2c0e48e1396692b13f8539ec6aec8ab3596443ab Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sat, 24 Jun 2017 13:47:06 -0500 Subject: [PATCH] Add missing file --- .../StatusExtensionContext+LoopKit.swift | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Loop/Models/StatusExtensionContext+LoopKit.swift diff --git a/Loop/Models/StatusExtensionContext+LoopKit.swift b/Loop/Models/StatusExtensionContext+LoopKit.swift new file mode 100644 index 0000000000..d1601c1cdb --- /dev/null +++ b/Loop/Models/StatusExtensionContext+LoopKit.swift @@ -0,0 +1,24 @@ +// +// StatusExtensionContext+LoopKit.swift +// Loop +// +// Copyright © 2017 LoopKit Authors. All rights reserved. +// + +import InsulinKit + +extension NetBasalContext { + var tempBasal: DoseEntry? { + guard rate != 0 else { + return nil + } + + return DoseEntry( + type: .tempBasal, + startDate: start, + endDate: end, + value: rate, + unit: .unitsPerHour + ) + } +}