NightscoutStatus.swift 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import Foundation
  2. struct NightscoutStatus: JSON {
  3. let device: String
  4. let openaps: OpenAPSStatus
  5. let pump: NSPumpStatus
  6. let preferences: Preferences
  7. let uploader: Uploader
  8. }
  9. struct OpenAPSStatus: JSON {
  10. let iob: IOBEntry?
  11. let suggested: Suggestion?
  12. let enacted: Suggestion?
  13. let version: String
  14. }
  15. struct NSPumpStatus: JSON {
  16. let clock: Date
  17. let battery: Battery?
  18. let reservoir: Decimal?
  19. let status: PumpStatus?
  20. }
  21. struct Uploader: JSON {
  22. let batteryVoltage: Decimal?
  23. let battery: Int
  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. }