Przeglądaj źródła

Make carbs_hr an Int as expected by Nightsocut.

Jan Dittmer 4 lat temu
rodzic
commit
b7c172acc1

+ 1 - 1
FreeAPS/Sources/Models/NightscoutStatus.swift

@@ -35,7 +35,7 @@ struct NightscoutTimevalue: JSON {
 
 struct ScheduledNightscoutProfile: JSON {
     let dia: Decimal
-    let carbs_hr: Decimal
+    let carbs_hr: Int
     let delay: Decimal
     let timezone: String
     let target_low: [NightscoutTimevalue]

+ 1 - 1
FreeAPS/Sources/Services/Network/NightscoutManager.swift

@@ -310,7 +310,7 @@ final class BaseNightscoutManager: NightscoutManager, Injectable {
         }
         let ps = ScheduledNightscoutProfile(
             dia: settingsManager.pumpSettings.insulinActionCurve,
-            carbs_hr: carbs_hr,
+            carbs_hr: Int(carbs_hr),
             delay: 0,
             timezone: TimeZone.current.identifier,
             target_low: target_low,