Kaynağa Gözat

Remove duplicate Pump Site Change NS event for Omnipods

Mike Plante 6 ay önce
ebeveyn
işleme
4b80c19ed1

+ 0 - 31
Trio/Sources/Services/Network/Nightscout/NightscoutManager.swift

@@ -582,10 +582,6 @@ final class BaseNightscoutManager: NightscoutManager, Injectable {
         } catch {
         } catch {
             debug(.nightscout, String(describing: error))
             debug(.nightscout, String(describing: error))
         }
         }
-
-        Task.detached {
-            await self.uploadPodAge()
-        }
     }
     }
 
 
     private func updateOrefDeterminationAsUploaded(_ determination: [Determination]) async {
     private func updateOrefDeterminationAsUploaded(_ determination: [Determination]) async {
@@ -610,33 +606,6 @@ final class BaseNightscoutManager: NightscoutManager, Injectable {
         }
         }
     }
     }
 
 
-    func uploadPodAge() async {
-        let uploadedPodAge = storage.retrieve(OpenAPS.Nightscout.uploadedPodAge, as: [NightscoutTreatment].self) ?? []
-        if let podAge = storage.retrieve(OpenAPS.Monitor.podAge, as: Date.self),
-           uploadedPodAge.last?.createdAt == nil || podAge != uploadedPodAge.last!.createdAt!
-        {
-            let siteTreatment = NightscoutTreatment(
-                duration: nil,
-                rawDuration: nil,
-                rawRate: nil,
-                absolute: nil,
-                rate: nil,
-                eventType: .nsSiteChange,
-                createdAt: podAge,
-                enteredBy: NightscoutTreatment.local,
-                bolus: nil,
-                insulin: nil,
-                notes: nil,
-                carbs: nil,
-                fat: nil,
-                protein: nil,
-                targetTop: nil,
-                targetBottom: nil
-            )
-            await uploadNonCoreDataTreatments([siteTreatment])
-        }
-    }
-
     func uploadProfiles() async throws {
     func uploadProfiles() async throws {
         if isUploadEnabled {
         if isUploadEnabled {
             do {
             do {