NightscoutStatus.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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: Suggestion?
  11. let enacted: Suggestion?
  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. }
  24. struct NightscoutTimevalue: JSON {
  25. let time: String
  26. let value: Decimal
  27. let timeAsSeconds: Int?
  28. }
  29. struct ScheduledNightscoutProfile: JSON {
  30. let dia: Decimal
  31. let carbs_hr: Int
  32. let delay: Decimal
  33. let timezone: String
  34. let target_low: [NightscoutTimevalue]
  35. let target_high: [NightscoutTimevalue]
  36. let sens: [NightscoutTimevalue]
  37. let basal: [NightscoutTimevalue]
  38. let carbratio: [NightscoutTimevalue]
  39. let units: String
  40. }
  41. struct NightscoutProfileStore: JSON {
  42. let defaultProfile: String
  43. let startDate: Date
  44. let mills: Int
  45. let units: String
  46. let enteredBy: String
  47. let store: [String: ScheduledNightscoutProfile]
  48. }