Bläddra i källkod

Release/0.1.7 (#16)

* Fixed glucose from xdip

* Bump version
Ivan 5 år sedan
förälder
incheckning
60d50932e3

+ 4 - 4
FreeAPS.xcodeproj/project.pbxproj

@@ -1968,7 +1968,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_ASSET_PATHS = "";
-				DEVELOPMENT_TEAM = BA7ZHP4963;
+				DEVELOPMENT_TEAM = "";
 				ENABLE_PREVIEWS = YES;
 				INFOPLIST_FILE = FreeAPS/Resources/Info.plist;
 				IPHONEOS_DEPLOYMENT_TARGET = 14.0;
@@ -1977,7 +1977,7 @@
 					"@executable_path/Frameworks",
 				);
 				MARKETING_VERSION = "$(CURRENT_PROJECT_VERSION)";
-				PRODUCT_BUNDLE_IDENTIFIER = ru.artpancreas.FreeAPS;
+				PRODUCT_BUNDLE_IDENTIFIER = "---CHANGE-IT-TO-YOUR-OWN---";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = "1,2";
@@ -1994,7 +1994,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_ASSET_PATHS = "";
-				DEVELOPMENT_TEAM = BA7ZHP4963;
+				DEVELOPMENT_TEAM = "";
 				ENABLE_PREVIEWS = YES;
 				INFOPLIST_FILE = FreeAPS/Resources/Info.plist;
 				IPHONEOS_DEPLOYMENT_TARGET = 14.0;
@@ -2003,7 +2003,7 @@
 					"@executable_path/Frameworks",
 				);
 				MARKETING_VERSION = "$(CURRENT_PROJECT_VERSION)";
-				PRODUCT_BUNDLE_IDENTIFIER = ru.artpancreas.FreeAPS;
+				PRODUCT_BUNDLE_IDENTIFIER = "---CHANGE-IT-TO-YOUR-OWN---";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = "1,2";

+ 1 - 1
FreeAPS/Resources/Config.xcconfig

@@ -1 +1 @@
-BUILD_VERSION = 0.1.6
+BUILD_VERSION = 0.1.7

+ 4 - 3
FreeAPS/Sources/APS/GlucoseManager.swift

@@ -7,7 +7,7 @@ protocol GlucoseManager {}
 
 final class BaseGlucoseManager: GlucoseManager, Injectable {
     private let processQueue = DispatchQueue(label: "BaseGlucoseManager.processQueue")
-    @Injected() var glucoseStogare: GlucoseStorage!
+    @Injected() var glucoseStorage: GlucoseStorage!
     @Injected() var nightscoutManager: NightscoutManager!
     @Injected() var apsManager: APSManager!
 
@@ -27,7 +27,7 @@ final class BaseGlucoseManager: GlucoseManager, Injectable {
                 debug(.nightscout, "Start fetching glucose")
                 return Publishers.CombineLatest3(
                     Just(date),
-                    Just(self.glucoseStogare.syncDate()),
+                    Just(self.glucoseStorage.syncDate()),
                     Publishers.CombineLatest(
                         self.nightscoutManager.fetchGlucose(),
                         self.fetchGlucoseFromSgaredGroup()
@@ -40,9 +40,10 @@ final class BaseGlucoseManager: GlucoseManager, Injectable {
             .sink { date, syncDate, glucose in
                 // Because of Spike dosn't respect a date query
                 let filteredByDate = glucose.filter { $0.dateString > syncDate }
-                let filtered = self.glucoseStogare.filterTooFrequentGlucose(filteredByDate, at: syncDate)
+                let filtered = self.glucoseStorage.filterTooFrequentGlucose(filteredByDate, at: syncDate)
                 if !filtered.isEmpty {
                     debug(.nightscout, "New glucose found")
+                    self.glucoseStorage.storeGlucose(filtered)
                     self.apsManager.heartbeat(date: date, force: true)
                 }
             }

+ 1 - 2
FreeAPS/Sources/APS/Storage/GlucoseStorage.swift

@@ -26,10 +26,9 @@ final class BaseGlucoseStorage: GlucoseStorage, Injectable {
 
     func storeGlucose(_ glucose: [BloodGlucose]) {
         processQueue.sync {
-            let filtered = self.filterTooFrequentGlucose(glucose, at: self.lastGlucoseDate())
             let file = OpenAPS.Monitor.glucose
             self.storage.transaction { storage in
-                storage.append(filtered, to: file, uniqBy: \.dateString)
+                storage.append(glucose, to: file, uniqBy: \.dateString)
                 let uniqEvents = storage.retrieve(file, as: [BloodGlucose].self)?
                     .filter { $0.dateString.addingTimeInterval(1.days.timeInterval) > Date() }
                     .sorted { $0.dateString > $1.dateString } ?? []

+ 0 - 4
FreeAPS/Sources/Services/Network/NightscoutManager.swift

@@ -83,10 +83,6 @@ final class BaseNightscoutManager: NightscoutManager, Injectable {
                 return Just([]).setFailureType(to: Error.self).eraseToAnyPublisher()
             })
             .replaceError(with: [])
-            .map {
-                self.glucoseStorage.storeGlucose($0)
-                return $0
-            }
             .eraseToAnyPublisher()
     }