PumpManagerExtensions.swift 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import LoopKit
  2. import LoopKitUI
  3. extension PumpManager {
  4. var rawValue: [String: Any] {
  5. [
  6. "managerIdentifier": pluginIdentifier, // "managerIdentifier": type(of: self).managerIdentifier,
  7. "state": rawState
  8. ]
  9. }
  10. }
  11. extension PumpManagerUI {
  12. // static func setupViewController() -> PumpManagerSetupViewController & UIViewController & CompletionNotifying {
  13. // setupViewController(
  14. // insulinTintColor: .accentColor,
  15. // guidanceColors: GuidanceColors(acceptable: .green, warning: .orange, critical: .red),
  16. // allowedInsulinTypes: [.apidra, .humalog, .novolog, .fiasp, .lyumjev]
  17. // )
  18. // }
  19. func settingsViewController(
  20. bluetoothProvider: BluetoothProvider,
  21. pumpManagerOnboardingDelegate: PumpManagerOnboardingDelegate?
  22. ) -> UIViewController & CompletionNotifying {
  23. var vc = settingsViewController(
  24. bluetoothProvider: bluetoothProvider,
  25. colorPalette: .default,
  26. allowDebugFeatures: true,
  27. allowedInsulinTypes: [.apidra, .humalog, .novolog, .fiasp, .lyumjev]
  28. )
  29. vc.pumpManagerOnboardingDelegate = pumpManagerOnboardingDelegate
  30. return vc
  31. }
  32. // func settingsViewController() -> UIViewController & CompletionNotifying {
  33. // settingsViewController(
  34. // insulinTintColor: .accentColor,
  35. // guidanceColors: GuidanceColors(acceptable: .green, warning: .orange, critical: .red),
  36. // allowedInsulinTypes: [.apidra, .humalog, .novolog, .fiasp, .lyumjev]
  37. // )
  38. // }
  39. }
  40. protocol PumpSettingsBuilder {
  41. func settingsViewController() -> UIViewController & CompletionNotifying
  42. }