NightscoutStatus.swift 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import Foundation
  2. struct NightscoutStatus: JSON {
  3. let device: String
  4. let openaps: OpenAPSStatus
  5. let pump: NSPumpStatus
  6. let uploader: Uploader
  7. }
  8. struct OpenAPSStatus: JSON {
  9. let iob: IOBEntry?
  10. let suggested: Determination?
  11. let enacted: Determination?
  12. let version: String
  13. }
  14. struct NSPumpStatus: JSON {
  15. let clock: Date
  16. let battery: Battery?
  17. let reservoir: Decimal?
  18. let status: PumpStatus?
  19. }
  20. struct Uploader: JSON {
  21. let batteryVoltage: Decimal?
  22. let battery: Int
  23. let isCharging: Bool?
  24. }
  25. struct NightscoutTimevalue: JSON {
  26. let time: String
  27. let value: Decimal
  28. let timeAsSeconds: Int?
  29. }
  30. struct ScheduledNightscoutProfile: JSON {
  31. let dia: Decimal
  32. let carbs_hr: Int
  33. let delay: Decimal
  34. let timezone: String
  35. let target_low: [NightscoutTimevalue]
  36. let target_high: [NightscoutTimevalue]
  37. let sens: [NightscoutTimevalue]
  38. let basal: [NightscoutTimevalue]
  39. let carbratio: [NightscoutTimevalue]
  40. let units: String
  41. }
  42. struct NightscoutProfileStore: JSON {
  43. let defaultProfile: String
  44. let startDate: Date
  45. let mills: Int
  46. let units: String
  47. let enteredBy: String
  48. let store: [String: ScheduledNightscoutProfile]
  49. let bundleIdentifier: String
  50. let deviceToken: String
  51. let isAPNSProduction: Bool
  52. let overridePresets: [NightscoutPresetOverride]?
  53. let teamID: String
  54. }
  55. struct NightscoutPresetOverride: JSON {
  56. let name: String
  57. let duration: Decimal?
  58. let percentage: Double?
  59. let target: Decimal?
  60. }