Skip to content

Commit

Permalink
Release/0.2.2 (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivalkou authored Nov 3, 2021
1 parent dfa433b commit 764816f
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension OmnipodPumpManagerError: LocalizedError {
case .podAlreadyPaired:
return LocalizedString("Pod already paired", comment: "Error message shown when user cannot pair because pod is already paired")
case .notReadyForCannulaInsertion:
return LocalizedString("Pod is not in a state ready for cannula insertion.", comment: "Error message when cannula insertion fails because the pod is in an unexpected state")
return LocalizedString("Pod is not in a state ready for cannula insertion", comment: "Error message when cannula insertion fails because the pod is in an unexpected state")
}
}

Expand Down Expand Up @@ -571,7 +571,7 @@ extension OmnipodPumpManager {
podState.activatedAt = start
podState.expiresAt = start + .hours(72)

let fault = mockFault ? try? DetailedStatus(encodedData: Data(hexadecimalString: "020d0000000e00c36a020703ff020900002899080082")!) : nil
let fault = mockFault ? try? DetailedStatus(encodedData: Data(hexadecimalString: "020f0000000900345c000103ff0001000005ae056029")!) : nil
podState.fault = fault

self.podComms = PodComms(podState: podState)
Expand Down Expand Up @@ -605,7 +605,7 @@ extension OmnipodPumpManager {
})
if mockFaultDuringPairing {
// needs to be PumpManagerError.communication for OmniKitUI error checking to work correctly
completion(.failure(PumpManagerError.communication(PodCommsError.podFault(fault: fault!))))
completion(.failure(PumpManagerError.deviceState(PodCommsError.podFault(fault: fault!))))
} else if mockCommsErrorDuringPairing {
completion(.failure(PumpManagerError.communication(PodCommsError.noResponse)))
} else {
Expand Down Expand Up @@ -694,12 +694,14 @@ extension OmnipodPumpManager {

#if targetEnvironment(simulator)
let mockDelay = TimeInterval(seconds: 3)
let mockFaultDuringInsertCannula = false
DispatchQueue.global(qos: .userInitiated).asyncAfter(deadline: .now() + mockDelay) {
let result = self.setStateWithResult({ (state) -> PumpManagerResult<TimeInterval> in
// Mock fault
// let fault = try! DetailedStatus(encodedData: Data(hexadecimalString: "020d0000000e00c36a020703ff020900002899080082")!)
// self.state.podState?.fault = fault
// return .failure(PumpManagerError.communication(PodCommsError.podFault(fault: fault)))
if mockFaultDuringInsertCannula {
let fault = try! DetailedStatus(encodedData: Data(hexadecimalString: "020d0000000e00c36a020703ff020900002899080082")!)
state.podState?.fault = fault
return .failure(PumpManagerError.deviceState(PodCommsError.podFault(fault: fault)))
}

// Mock success
state.podState?.setupProgress = .completed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,19 @@ class InsertCannulaSetupViewController: SetupTableViewController {
}
loadingText = errorText

var podCommsError: PodCommsError? = nil
let podCommsError: PodCommsError?
if let pumpManagerError = lastError as? PumpManagerError {
switch pumpManagerError {
case .communication(let error):
// Check for a wrapped PodCommsError in the possible PumpManagerError types
case .communication(let error), .configuration(let error), .connection(let error), .deviceState(let error):
podCommsError = error as? PodCommsError
default:
podCommsError = nil
break
}
} else {
// Check for a non PumpManagerError PodCommsError
podCommsError = lastError as? PodCommsError
}

// If we have an error, update the continue state depending on whether it's fatal or if the cannula insertion was started or not
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,19 @@ class PairPodSetupViewController: SetupTableViewController {
errorStrings = [lastError?.localizedDescription].compactMap { $0 }
}

var podCommsError: PodCommsError? = nil
let podCommsError: PodCommsError?
if let pumpManagerError = lastError as? PumpManagerError {
switch pumpManagerError {
case .communication(let error):
// Check for a wrapped PodCommsError in the possible PumpManagerError types
case .communication(let error), .configuration(let error), .connection(let error), .deviceState(let error):
podCommsError = error as? PodCommsError
default:
podCommsError = nil
break
}
} else {
// Check for a non PumpManagerError PodCommsError
podCommsError = lastError as? PodCommsError
}

if let podCommsError = podCommsError, podCommsError.possibleWeakCommsCause {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ public class RileyLinkDeviceManager: NSObject {
lockedTimerTickEnabled.value = newValue
centralQueue.async {
for device in self.devices {
device.setTimerTickEnabled(newValue)
if device.peripheralState == .connected {
device.setTimerTickEnabled(newValue)
}
}
}
}
Expand Down Expand Up @@ -163,8 +165,10 @@ extension RileyLinkDeviceManager {
device.manager.peripheral = peripheral
} else {
device = RileyLinkDevice(peripheralManager: PeripheralManager(peripheral: peripheral, configuration: .rileyLink, centralManager: central, queue: sessionQueue))
device.setTimerTickEnabled(timerTickEnabled)
device.setIdleListeningState(idleListeningState)
if peripheral.state == .connected {
device.setTimerTickEnabled(timerTickEnabled)
device.setIdleListeningState(idleListeningState)
}

devices.append(device)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
"Disconnected" = "Getrennt";

/* The in-progress disconnecting state */
"Disconnecting" = "trennen";
"Disconnecting" = "Trennen";

/* The title of the cell showing firmware version */
"Firmware" = "Firmware";

/* The title of the cell showing current rileylink frequency */
"Frequency" = "Frequency";
"Frequency" = "Frequenz";

/* The title of the cell showing device name */
"Name" = "Nombre";
"Name" = "Name";

/* RileyLink setup description */
"RileyLink allows for communication with the pump over Bluetooth Low Energy." = "RileyLink ermöglicht Kommunikation zur Pumpe über Bluetooth Low Energy.";
Expand All @@ -38,67 +38,67 @@
"Signal Strength" = "Signalstärke";

/* The header of the cells showing connection monitoring */
"Connection Monitoring" = "Connection Monitoring";
"Connection Monitoring" = "Verbindungsüberwachung";

/* The title of the cell showing uptime */
"Uptime" = "Uptime";
"Uptime" = "Betriebszeit";

/* The title of the cell showing battery level */
"Battery level" = "Battery level";
"Battery level" = "Ladezustand";

/* The title of the cell showing Voltage */
"Voltage" = "Voltage";
"Voltage" = "Spannung";

/* "The title of the section for alerts" */
"Alert" = "Alert";
"Alert" = "Alarmierung";

/* The title of the cell showing Low Battery Alert */
"Low Battery Alert" = "Low Battery Alert";
"Low Battery Alert" = "Warnung bei schwacher Batterie";

/* Header of list showing battery level alert options */
"Battery level Alert" = "Battery level Alert";
"Battery level Alert" = "Ladezustandswarnung";

/* Battery level alert OFF in list of options */
"OFF" = "OFF";
"OFF" = "Aus";

/* The title of the command to update diagnostic LEDs */
"Diagnostic LEDs" = "Diagnostic LEDs";
"Diagnostic LEDs" = "Diagnose LEDs";

/* The title of the command to fetch RileyLink statistics */
"Get RileyLink Statistics" = "Get RileyLink Statistics";
"Get RileyLink Statistics" = "RileyLink Messwerte abrufen";

/* The title of the command to invert BLE connection LED logic */
"Invert LED Logic" = "Invert LED Logic";
"Invert LED Logic" = "LED Logik umkehren";

/* The header of the cells showing test commands */
"Test Commands" = "Test Commands";
"Test Commands" = "Testbefehle";

/* The title of the cell showing Lighten Yellow LED */
"Lighten Yellow LED" = "Lighten Yellow LED";
"Lighten Yellow LED" = "Gelbe LED aktivieren";

/* The title of the cell showing Lighten Yellow LED */
"Lighten Red LED" = "Lighten Red LED";
"Lighten Red LED" = "Rote LED aktivieren";

/* The title of the cell showing Test Vibration */
"Test Vibration" = "Test Vibration";
"Test Vibration" = "Vibration aktivieren";

/* The title of the cell for sounding device finding piezo */
"Find Device" = "Find Device";
"Find Device" = "Gerät lokalisieren";

/* The title of the cell for connection LED */
"Connection LED" = "Connection LED";
"Connection LED" = "Verbindungs-LED";

/* The title of the cell for connection vibration */
"Connection Vibration" = "Connection Vibration";
"Connection Vibration" = "Vibrieren bei Verbindung";

/* Detail text when battery alert disabled. */
"Off" = "Off";
"Off" = "Aus";

/* Text indicating LED Mode is on */
"On" = "On";
"On" = "An";

/* Text indicating LED Mode is off */
"Off" = "Off";
"Off" = "Aus";

/* Text indicating LED Mode is auto */
"Auto" = "Auto";
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"Firmware" = "Прошивка";

/* The title of the cell showing current rileylink frequency */
"Frequency" = "Frequency";
"Frequency" = "Частота";

/* The title of the cell showing device name */
"Name" = "Название";
Expand All @@ -38,67 +38,67 @@
"Signal Strength" = "Уровень сигнала";

/* The header of the cells showing connection monitoring */
"Connection Monitoring" = "Connection Monitoring";
"Connection Monitoring" = "Проверка подключения";

/* The title of the cell showing uptime */
"Uptime" = "Uptime";
"Uptime" = "Время непрерывной работы";

/* The title of the cell showing battery level */
"Battery level" = "Battery level";
"Battery level" = "Уровень заряда батареи";

/* The title of the cell showing Voltage */
"Voltage" = "Voltage";
"Voltage" = "Напряжение";

/* "The title of the section for alerts" */
"Alert" = "Alert";

/* The title of the cell showing Low Battery Alert */
"Low Battery Alert" = "Low Battery Alert";
"Low Battery Alert" = "Предупредить при уровне заряда";

/* Header of list showing battery level alert options */
"Battery level Alert" = "Battery level Alert";
"Battery level Alert" = "Уровень предупреждения о низком заряде";

/* Battery level alert OFF in list of options */
"OFF" = "OFF";
"OFF" = "Не предупреждать";

/* The title of the command to update diagnostic LEDs */
"Diagnostic LEDs" = "Diagnostic LEDs";
"Diagnostic LEDs" = "Индикатор диагностики";

/* The title of the command to fetch RileyLink statistics */
"Get RileyLink Statistics" = "Get RileyLink Statistics";
"Get RileyLink Statistics" = "Статистика RileyLink";

/* The title of the command to invert BLE connection LED logic */
"Invert LED Logic" = "Invert LED Logic";
"Invert LED Logic" = "Обратная логика индикации";

/* The header of the cells showing test commands */
"Test Commands" = "Test Commands";
"Test Commands" = "Проверочные команды";

/* The title of the cell showing Lighten Yellow LED */
"Lighten Yellow LED" = "Lighten Yellow LED";
"Lighten Yellow LED" = "Светло-желтый индикатор";

/* The title of the cell showing Lighten Yellow LED */
"Lighten Red LED" = "Lighten Red LED";
"Lighten Red LED" = "Светло-красный индикатор";

/* The title of the cell showing Test Vibration */
"Test Vibration" = "Test Vibration";
"Test Vibration" = "Проверка вибрации";

/* The title of the cell for sounding device finding piezo */
"Find Device" = "Find Device";
"Find Device" = "Поиск устройства";

/* The title of the cell for connection LED */
"Connection LED" = "Connection LED";
"Connection LED" = "Индикатор подключения";

/* The title of the cell for connection vibration */
"Connection Vibration" = "Connection Vibration";
"Connection Vibration" = "Вибрировать при потере связи";

/* Detail text when battery alert disabled. */
"Off" = "Off";
"Off" = "Нет";

/* Text indicating LED Mode is on */
"On" = "On";
"On" = "Вкл";

/* Text indicating LED Mode is off */
"Off" = "Off";
"Off" = "Выкл";

/* Text indicating LED Mode is auto */
"Auto" = "Auto";
"Auto" = "Авто";
4 changes: 2 additions & 2 deletions FreeAPS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = BA7ZHP4963;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = FreeAPS/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand All @@ -2180,7 +2180,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = BA7ZHP4963;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = FreeAPS/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand Down
2 changes: 1 addition & 1 deletion FreeAPS/Resources/Config.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BUILD_VERSION = 0.2.1
BUILD_VERSION = 0.2.2
Loading

0 comments on commit 764816f

Please sign in to comment.