Просмотр исходного кода

Remove a bunch of stuff to silence build warnings

Deniz Cengiz 1 год назад
Родитель
Сommit
f00c3e5e96

+ 0 - 4
FreeAPS.xcodeproj/project.pbxproj

@@ -496,7 +496,6 @@
 		F90692D3274B9A130037068D /* AppleHealthKitRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F90692D2274B9A130037068D /* AppleHealthKitRootView.swift */; };
 		F90692D6274B9A450037068D /* HealthKitStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F90692D5274B9A450037068D /* HealthKitStateModel.swift */; };
 		FA630397F76B582C8D8681A7 /* BasalProfileEditorProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42369F66CF91F30624C0B3A6 /* BasalProfileEditorProvider.swift */; };
-		FE41E4D429463C660047FD55 /* NightscoutStatistics.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE41E4D329463C660047FD55 /* NightscoutStatistics.swift */; };
 		FE41E4D629463EE20047FD55 /* NightscoutPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE41E4D529463EE20047FD55 /* NightscoutPreferences.swift */; };
 		FE66D16B291F74F8005D6F77 /* Bundle+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE66D16A291F74F8005D6F77 /* Bundle+Extensions.swift */; };
 		FEFFA7A22929FE49007B8193 /* UIDevice+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEFFA7A12929FE49007B8193 /* UIDevice+Extensions.swift */; };
@@ -1133,7 +1132,6 @@
 		F90692D2274B9A130037068D /* AppleHealthKitRootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleHealthKitRootView.swift; sourceTree = "<group>"; };
 		F90692D5274B9A450037068D /* HealthKitStateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HealthKitStateModel.swift; sourceTree = "<group>"; };
 		FBB3BAE7494CB771ABAC7B8B /* ISFEditorRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ISFEditorRootView.swift; sourceTree = "<group>"; };
-		FE41E4D329463C660047FD55 /* NightscoutStatistics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NightscoutStatistics.swift; sourceTree = "<group>"; };
 		FE41E4D529463EE20047FD55 /* NightscoutPreferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NightscoutPreferences.swift; sourceTree = "<group>"; };
 		FE66D16A291F74F8005D6F77 /* Bundle+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+Extensions.swift"; sourceTree = "<group>"; };
 		FEFFA7A12929FE49007B8193 /* UIDevice+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIDevice+Extensions.swift"; sourceTree = "<group>"; };
@@ -1875,7 +1873,6 @@
 				CE82E02628E869DF00473A9C /* AlertEntry.swift */,
 				19B0EF2028F6D66200069496 /* Statistics.swift */,
 				19012CDB291D2CB900FB8210 /* LoopStats.swift */,
-				FE41E4D329463C660047FD55 /* NightscoutStatistics.swift */,
 				FE41E4D529463EE20047FD55 /* NightscoutPreferences.swift */,
 				191F62672AD6B05A004D7911 /* NightscoutSettings.swift */,
 				1967DFBD29D052C200759F30 /* Icons.swift */,
@@ -3475,7 +3472,6 @@
 				F90692D6274B9A450037068D /* HealthKitStateModel.swift in Sources */,
 				BD1661312B82ADAB00256551 /* CustomProgressView.swift in Sources */,
 				C967DACD3B1E638F8B43BE06 /* ManualTempBasalStateModel.swift in Sources */,
-				FE41E4D429463C660047FD55 /* NightscoutStatistics.swift in Sources */,
 				38E4453B274E411700EC9A94 /* Disk+VolumeInformation.swift in Sources */,
 				7BCFACB97C821041BA43A114 /* ManualTempBasalRootView.swift in Sources */,
 				38E44534274E411700EC9A94 /* Disk+InternalHelpers.swift in Sources */,

+ 1 - 1
FreeAPS/Sources/APS/APSManager.swift

@@ -1018,7 +1018,7 @@ final class BaseAPSManager: APSManager, Injectable {
             }
 
             // Insulin placeholder
-            var insulin = Ins(
+            let insulin = Ins(
                 TDD: 0,
                 bolus: 0,
                 temp_basal: 0,

+ 0 - 1
FreeAPS/Sources/APS/OpenAPS/OpenAPS.swift

@@ -466,7 +466,6 @@ final class OpenAPS {
             let weighted_average = weight * average2hours + (1 - weight) * average14
 
             var duration: Decimal = 0
-            var newDuration: Decimal = 0
             var overrideTarget: Decimal = 0
 
             if useOverride {

+ 2 - 2
FreeAPS/Sources/APS/PluginManager.swift

@@ -26,10 +26,10 @@ class BasePluginManager: Injectable, PluginManager {
                 {
                     if let bundle = Bundle(url: pluginURL) {
                         if let bname = bundle.object(forInfoDictionaryKey: "CFBundleName") as? String {
-                            debug(.deviceManager, "bundle name2:\(bname)")
+                            debug(.deviceManager, "bundle name: \(bname)")
                         }
                         if let bcgm = bundle.object(forInfoDictionaryKey: "com.loopkit.Loop.CGMManagerIdentifier") as? String {
-                            debug(.deviceManager, "bundle is CGM")
+                            debug(.deviceManager, "bundle is CGM: \(bcgm)")
                         }
 
                         if bundle.isLoopPlugin {

+ 0 - 2
FreeAPS/Sources/APS/Storage/DeterminationStorage.swift

@@ -126,8 +126,6 @@ final class BaseDeterminationStorage: DeterminationStorage, Injectable {
 
                 // Check if the fetched object is of the expected type
                 if let orefDetermination = orefDetermination {
-                    let forecastSet = orefDetermination.forecasts
-
                     result = Determination(
                         id: orefDetermination.id ?? UUID(),
                         reason: orefDetermination.reason ?? "",

+ 0 - 10
FreeAPS/Sources/Models/BloodGlucose.swift

@@ -20,43 +20,33 @@ struct BloodGlucose: JSON, Identifiable, Hashable {
         init?(from string: String) {
             switch string {
             case "\u{2191}\u{2191}\u{2191}",
-                 "↑↑↑",
                  "TripleUp":
                 self = .tripleUp
             case "\u{2191}\u{2191}",
-                 "↑↑",
                  "DoubleUp":
                 self = .doubleUp
             case "\u{2191}",
-                 "↑",
                  "SingleUp":
                 self = .singleUp
             case "\u{2197}",
-                 "↗︎",
                  "FortyFiveUp":
                 self = .fortyFiveUp
             case "\u{2192}",
-                 "→",
                  "Flat":
                 self = .flat
             case "\u{2198}",
-                 "↘︎",
                  "FortyFiveDown":
                 self = .fortyFiveDown
             case "\u{2193}",
-                 "↓",
                  "SingleDown":
                 self = .singleDown
             case "\u{2193}\u{2193}",
-                 "↓↓",
                  "DoubleDown":
                 self = .doubleDown
             case "\u{2193}\u{2193}\u{2193}",
-                 "↓↓↓",
                  "TripleDown":
                 self = .tripleDown
             case "\u{2194}",
-                 "↔︎",
                  "NONE":
                 self = .none
             case "NOT COMPUTABLE":

+ 0 - 6
FreeAPS/Sources/Models/NightscoutStatistics.swift

@@ -1,6 +0,0 @@
-import Foundation
-
-struct NightscoutStatistics: JSON {
-    let report = "statistics"
-    let dailystats: Statistics?
-}

+ 2 - 2
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -1216,8 +1216,8 @@ extension MainChartView {
         // Ensure maxForecast is not more than 100 over maxGlucose
         let adjustedMaxForecast = min(maxForecast, maxGlucose + 100)
 
-        var minOverall = min(minGlucose, minForecast)
-        var maxOverall = max(maxGlucose, adjustedMaxForecast)
+        let minOverall = min(minGlucose, minForecast)
+        let maxOverall = max(maxGlucose, adjustedMaxForecast)
 
         minValue = minOverall - 50
         maxValue = maxOverall + 80

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

@@ -496,7 +496,7 @@ extension NightscoutAPI {
         }
         request.httpMethod = "POST"
 
-        let (data, response) = try await URLSession.shared.data(for: request)
+        let (_, response) = try await URLSession.shared.data(for: request)
 
         // Check the response status code
         guard let httpResponse = response as? HTTPURLResponse, 200 ..< 300 ~= httpResponse.statusCode else {

+ 0 - 2
FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift

@@ -33,8 +33,6 @@ import Foundation
             cob: iob_cob.cob,
             unit: stateIntent.settingsManager.settings.units
         )
-        let iob_text = String(format: "%.2f", iob_cob.iob)
-        let cob_text = String(format: "%.2f", iob_cob.cob)
         return .result(
             value: BG,
             view: ListStateView(state: BG)