From 08e6a801a21d8d742f9cccebb5102913df00a68f Mon Sep 17 00:00:00 2001 From: Mike Plante Date: Wed, 8 May 2024 15:01:09 -0400 Subject: [PATCH] scrub old name from code in Shortcuts, HealthKit, FileStorageTests, and URLs --- FreeAPS/Resources/Info.plist | 6 +----- FreeAPS/Sources/Services/HealthKit/HealthKitManager.swift | 4 ++-- FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift | 4 ++-- FreeAPS/Sources/Shortcuts/State/ListStateView.swift | 2 +- FreeAPS/Sources/Shortcuts/State/StateIntentRequest.swift | 6 +++--- FreeAPSTests/FileStorageTests.swift | 2 +- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/FreeAPS/Resources/Info.plist b/FreeAPS/Resources/Info.plist index edd8a6c1..157abb53 100644 --- a/FreeAPS/Resources/Info.plist +++ b/FreeAPS/Resources/Info.plist @@ -4,10 +4,6 @@ AppGroupID $(APP_GROUP_ID) - BGTaskSchedulerPermittedIdentifiers - - com.freeapsx.background-task.critical-event-log - CBBundleDisplayName $(APP_DISPLAY_NAME) CFBundleDevelopmentRegion @@ -32,7 +28,7 @@ CFBundleTypeRole None CFBundleURLName - com.artificial-pancreas-iaps + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleURLSchemes $(APP_URL_SCHEME) diff --git a/FreeAPS/Sources/Services/HealthKit/HealthKitManager.swift b/FreeAPS/Sources/Services/HealthKit/HealthKitManager.swift index 3b43ff55..c9948bd8 100644 --- a/FreeAPS/Sources/Services/HealthKit/HealthKitManager.swift +++ b/FreeAPS/Sources/Services/HealthKit/HealthKitManager.swift @@ -495,8 +495,8 @@ final class BaseHealthKitManager: HealthKitManager, Injectable, CarbsObserver, P newGlucose += samples .compactMap { sample -> HealthKitSample? in - let fromFAX = sample.metadata?[Config.freeAPSMetaKey] as? Bool ?? false - guard !fromFAX else { return nil } + let fromTrio = sample.metadata?[Config.freeAPSMetaKey] as? Bool ?? false + guard !fromTrio else { return nil } return HealthKitSample( healthKitId: sample.uuid.uuidString, date: sample.startDate, diff --git a/FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift b/FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift index 684f2106..3877fd48 100644 --- a/FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift +++ b/FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift @@ -16,13 +16,13 @@ import Foundation Summary("List all states of Trio") } - @MainActor func perform() async throws -> some ReturnsValue & ShowsSnippetView { + @MainActor func perform() async throws -> some ReturnsValue & ShowsSnippetView { let glucoseValues = try? stateIntent.getLastBG() let iob_cob_value = try? stateIntent.getIOB_COB() guard let glucoseValue = glucoseValues else { throw StateIntentError.NoBG } guard let iob_cob = iob_cob_value else { throw StateIntentError.NoIOBCOB } - let BG = StateiAPSResults( + let BG = StateResults( glucose: glucoseValue.glucose, trend: glucoseValue.trend, delta: glucoseValue.delta, diff --git a/FreeAPS/Sources/Shortcuts/State/ListStateView.swift b/FreeAPS/Sources/Shortcuts/State/ListStateView.swift index 3c80d85a..9b0f043a 100644 --- a/FreeAPS/Sources/Shortcuts/State/ListStateView.swift +++ b/FreeAPS/Sources/Shortcuts/State/ListStateView.swift @@ -3,7 +3,7 @@ import Foundation import SwiftUI struct ListStateView: View { - var state: StateiAPSResults + var state: StateResults private var numberFormatter: NumberFormatter { let formatter = NumberFormatter() diff --git a/FreeAPS/Sources/Shortcuts/State/StateIntentRequest.swift b/FreeAPS/Sources/Shortcuts/State/StateIntentRequest.swift index 4c7aa11b..34d65aea 100644 --- a/FreeAPS/Sources/Shortcuts/State/StateIntentRequest.swift +++ b/FreeAPS/Sources/Shortcuts/State/StateIntentRequest.swift @@ -7,7 +7,7 @@ enum StateIntentError: Error { case NoIOBCOB } -@available(iOS 16, *) struct StateiAPSResults: AppEntity { +@available(iOS 16, *) struct StateResults: AppEntity { static var defaultQuery = StateBGQuery() static var typeDisplayRepresentation: TypeDisplayRepresentation = "Trio State Result" @@ -44,11 +44,11 @@ enum StateIntentError: Error { } @available(iOS 16.0, *) struct StateBGQuery: EntityQuery { - func entities(for _: [StateiAPSResults.ID]) async throws -> [StateiAPSResults] { + func entities(for _: [StateResults.ID]) async throws -> [StateResults] { [] } - func suggestedEntities() async throws -> [StateiAPSResults] { + func suggestedEntities() async throws -> [StateResults] { [] } } diff --git a/FreeAPSTests/FileStorageTests.swift b/FreeAPSTests/FileStorageTests.swift index 67689004..4189ed75 100644 --- a/FreeAPSTests/FileStorageTests.swift +++ b/FreeAPSTests/FileStorageTests.swift @@ -9,7 +9,7 @@ class FileStorageTests: XCTestCase { let value: Decimal } - func testFileStorageOiAPS() { + func testFileStorageTrio() { let dummyObject = DummyObject(id: "21342Z", value: 78.2) fileStorage.save(dummyObject, as: "dummyObject") let dummyObjectRetrieve = fileStorage.retrieve("dummyObject", as: DummyObject.self)