TempBasalRecommendation.swift 677 B

123456789101112131415161718192021222324252627
  1. //
  2. // TempBasalRecommendation.swift
  3. // LoopKit
  4. //
  5. // Created by Darin Krauss on 5/21/19.
  6. // Copyright © 2019 LoopKit Authors. All rights reserved.
  7. //
  8. import Foundation
  9. public struct TempBasalRecommendation: Equatable {
  10. public let unitsPerHour: Double
  11. public let duration: TimeInterval
  12. /// A special command which cancels any existing temp basals
  13. public static var cancel: TempBasalRecommendation {
  14. return self.init(unitsPerHour: 0, duration: 0)
  15. }
  16. public init(unitsPerHour: Double, duration: TimeInterval) {
  17. self.unitsPerHour = unitsPerHour
  18. self.duration = duration
  19. }
  20. }
  21. extension TempBasalRecommendation: Codable {}