Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions NightscoutServiceKit/Extensions/StoredDosingDecision.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ extension StoredDosingDecision {
model: pumpManagerStatus.device.model,
iob: nil,
battery: pumpStatusBattery,
suspended: pumpManagerStatus.basalDeliveryState.isSuspended,
suspended: pumpManagerStatus.basalDeliveryState?.isSuspended,
bolusing: pumpStatusBolusing,
reservoir: pumpStatusReservoir,
secondsFromGMT: pumpManagerStatus.timeZone.secondsFromGMT())
}

var overrideStatus: NightscoutUploadKit.OverrideStatus {
guard let scheduleOverride = scheduleOverride, scheduleOverride.isActive(),
let glucoseTargetRange = glucoseTargetRangeScheduleApplyingOverrideIfActive?.value(at: date) else
let glucoseTargetRange = effectiveGlucoseTargetRangeSchedule?.value(at: date) else
{
return NightscoutUploadKit.OverrideStatus(timestamp: date, active: false)
}
Expand Down
2 changes: 2 additions & 0 deletions NightscoutServiceKitPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@
<string>Nightscout Service</string>
<key>com.loopkit.Loop.ServiceIdentifier</key>
<string>NightscoutService</string>
<key>com.loopkit.Loop.Plugin.ProvidesOnboarding</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion NightscoutServiceKitUI/Extensions/Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// DashKitUI
//
// Created by Pete Schwamb on 2/7/20.
// Copyright © 2020 Tidepool. All rights reserved.
// Copyright © 2020 LoopKit Authors. All rights reserved.
//

import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion NightscoutServiceKitUI/Models/KeyboardObserver.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// KeyboardObserver.swift
// TidepoolServiceKitUI
// NightscoutServiceKitUI
//
// Created by Pete Schwamb on 9/7/20.
// Copyright © 2020 LoopKit Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SettingsReviewViewModel.swift
// TidepoolServiceKitUI
// NightscoutServiceKitUI
//
// Created by Pete Schwamb on 9/7/20.
// Copyright © 2020 LoopKit Authors. All rights reserved.
Expand Down
9 changes: 8 additions & 1 deletion NightscoutServiceKitUI/NightscoutService+UI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import NightscoutServiceKit
import HealthKit

extension NightscoutService: ServiceUI {

public static var image: UIImage? {
UIImage(named: "nightscout", in: Bundle(for: ServiceUICoordinator.self), compatibleWith: nil)!
}

public static var providesOnboarding: Bool { return true }

public static func setupViewController(currentTherapySettings: TherapySettings, preferredGlucoseUnit: HKUnit, chartColors: ChartColorPalette, carbTintColor: Color, glucoseTintColor: Color, guidanceColors: GuidanceColors, insulinTintColor: Color) -> (UIViewController & ServiceSetupNotifying & CompletionNotifying)? {

Expand All @@ -27,4 +28,10 @@ extension NightscoutService: ServiceUI {
return ServiceUICoordinator(service: self, therapySettings: currentTherapySettings, preferredGlucoseUnit: preferredGlucoseUnit, chartColors: chartColors, carbTintColor: carbTintColor, glucoseTintColor: glucoseTintColor, guidanceColors: guidanceColors, insulinTintColor: insulinTintColor)
}

public func supportMenuItem(supportInfoProvider: SupportInfoProvider, urlHandler: @escaping (URL) -> Void) -> AnyView? {
return AnyView(Button("Submit Bug Report", action: {
let url = URL(string: "https://github.com/LoopKit/Loop/issues")!
urlHandler(url)
}))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ class ServiceUICoordinator: UINavigationController, CompletionNotifying, UINavig
return TherapySettingsViewModel(
mode: .acceptanceFlow,
therapySettings: therapySettings,
glucoseUnit: preferredGlucoseUnit,
preferredGlucoseUnit: preferredGlucoseUnit,
supportedInsulinModelSettings: supportedInsulinModelSettings,
pumpSupportedIncrements: { pumpSupportedIncrements },
syncPumpSchedule: {
Expand Down