PumpManagerExtensions.swift 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import LoopKit
  2. import LoopKitUI
  3. extension PumpManager {
  4. var rawValue: [String: Any] {
  5. [
  6. "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() -> UIViewController & CompletionNotifying {
  20. settingsViewController(
  21. insulinTintColor: .accentColor,
  22. guidanceColors: GuidanceColors(acceptable: .green, warning: .orange, critical: .red),
  23. allowedInsulinTypes: [.apidra, .humalog, .novolog, .fiasp, .lyumjev]
  24. )
  25. }
  26. }
  27. protocol PumpSettingsBuilder {
  28. func settingsViewController() -> UIViewController & CompletionNotifying
  29. }