NightscoutStatus.swift 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. let dailystats: Statistics?
  9. }
  10. struct OpenAPSStatus: JSON {
  11. let iob: IOBEntry?
  12. let suggested: Suggestion?
  13. let enacted: Suggestion?
  14. let version: String
  15. }
  16. struct NSPumpStatus: JSON {
  17. let clock: Date
  18. let battery: Battery?
  19. let reservoir: Decimal?
  20. let status: PumpStatus?
  21. }
  22. struct Uploader: JSON {
  23. let batteryVoltage: Decimal?
  24. let battery: Int
  25. }
  26. struct NightscoutTimevalue: JSON {
  27. let time: String
  28. let value: Decimal
  29. let timeAsSeconds: Int
  30. }
  31. struct ScheduledNightscoutProfile: JSON {
  32. let dia: Decimal
  33. let carbs_hr: Int
  34. let delay: Decimal
  35. let timezone: String
  36. let target_low: [NightscoutTimevalue]
  37. let target_high: [NightscoutTimevalue]
  38. let sens: [NightscoutTimevalue]
  39. let basal: [NightscoutTimevalue]
  40. let carbratio: [NightscoutTimevalue]
  41. let units: String
  42. }
  43. struct NightscoutProfileStore: JSON {
  44. let defaultProfile: String
  45. let startDate: Date
  46. let mills: Int
  47. let units: String
  48. let enteredBy: String
  49. let store: [String: ScheduledNightscoutProfile]
  50. }