Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.2.1.0 #3262

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

3.2.1.0 #3262

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7fffbc7
Medtrum: Add additional checks to bolus packet
Mar 2, 2024
2afcbd8
3.2.0.4-dev
Mar 2, 2024
d32909d
Merge pull request #3249 from jbr7rr/medtrum-additional-checks
MilosKozak Mar 3, 2024
2bbf05a
fix max bolus in pregnant mode
MilosKozak Mar 3, 2024
4340b0b
Equil support
MilosKozak Mar 11, 2024
7d78b8a
3.2.1.0
MilosKozak Mar 11, 2024
74879ed
circleci
MilosKozak Mar 11, 2024
c047401
Medtrum: Remove reset of device address on disconnect during connecting
Mar 18, 2024
024531a
Medtrum: Reset device address when starting new scan
Mar 21, 2024
fbd6444
add key length check
MilosKozak May 23, 2024
e40de38
fix PluginsListModule
MilosKozak May 10, 2024
386baf9
chore(deps): bump com.android.tools.build:gradle from 8.2.1 to 8.2.2
dependabot[bot] Jan 24, 2024
74807a7
chore(deps): bump com.google.gms:google-services from 4.4.0 to 4.4.1
dependabot[bot] Feb 9, 2024
b47b39c
chore(deps): bump com.android.tools.build:gradle from 8.2.2 to 8.3.0
dependabot[bot] Mar 1, 2024
4ba29ae
chore(deps): bump com.android.tools.build:gradle from 8.3.0 to 8.3.1
dependabot[bot] Mar 19, 2024
b698c5a
chore(deps): bump com.android.tools.build:gradle from 8.3.1 to 8.3.2
dependabot[bot] Apr 10, 2024
2dc7afb
libs update
MilosKozak Mar 3, 2024
0119b27
Revert "libs update"
MilosKozak Mar 18, 2024
c3264c0
gradle update
MilosKozak Mar 18, 2024
e373e7c
Gradle update
MilosKozak May 6, 2024
6d349d6
SMS: NSCLIENT -> AAPSCLIENT
MilosKozak May 7, 2024
7d73e5d
fix tests
MilosKozak May 8, 2024
5e1608f
Fixed equil pump set temp Basal 'none' bug
EquilHack Jul 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 40 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,58 @@ version: 2.1

# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.
orbs:
android: circleci/android@2.3.0
android: circleci/android@2.4.0
codecov: codecov/codecov@3.3.0

jobs:
# Below is the definition of your job to build and test your app, you can rename and customize it as you want.
build-and-test:
# These next lines define the Android machine image executor: https://circleci.com/docs/2.0/executor-types/
executor:
name: android/android-machine
resource-class: large
tag: 2023.11.1
machine: true
resource_class: nightscout/android

steps:
- checkout

- android/change-java-version:
java-version: 17
- run:
name: Create avd
command: |
echo "no" | /opt/android-sdk/cmdline-tools/latest/bin/avdmanager --verbose create avd -n citest -k "system-images;android-29;google_apis_playstore;x86" --force

- run:
name: Launch emulator
command: |
export ANDROID_SDK_ROOT=/opt/android-sdk
export ANDROID_HOME=/opt/android-sdk
emulator -avd citest -delay-adb -verbose -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
background: true

- run:
name: Run connectedFullDebugAndroidTest
command: |
export ANDROID_SDK_ROOT=/opt/android-sdk
export ANDROID_HOME=/opt/android-sdk
env
./gradlew -Dorg.gradle.jvmargs=-Xmx6g connectedFullDebugAndroidTest

- android/start-emulator-and-run-tests:
system-image: system-images;android-29;google_apis;x86
# Compile while the emulator starts to use the time.
post-emulator-launch-assemble-command: ./gradlew compileFullDebugUnitTestSources compileFullDebugAndroidTestSources
test-command: ./gradlew connectedFullDebugAndroidTest
- run:
name: Kill emulators
command: |
echo "Killing emulators"
adb devices | grep emulator | cut -f1 | while read -r line; do adb -s $line emu kill; done

- android/run-tests:
test-command: ./gradlew testFullDebugUnitTest
- run:
name: Run testFullDebugUnitTest
command: |
export ANDROID_SDK_ROOT=/opt/android-sdk
export ANDROID_HOME=/opt/android-sdk
./gradlew -Dorg.gradle.jvmargs=-Xmx6g testFullDebugUnitTest

- android/run-tests:
test-command: ./gradlew --stacktrace jacocoAllDebugReport
- run:
run: Run jacocoAllDebugReport
command: |
export ANDROID_SDK_ROOT=/opt/android-sdk
export ANDROID_HOME=/opt/android-sdk
./gradlew --stacktrace jacocoAllDebugReport

- run:
name: Save test results
Expand Down
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ dependencies {
implementation(project(":pump:danar"))
implementation(project(":pump:diaconn"))
implementation(project(":pump:eopatch"))
implementation(project(":pump:equil"))
implementation(project(":pump:medtrum"))
implementation(project(":insight"))
implementation(project(":pump:medtronic"))
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/kotlin/app/aaps/di/AppComponent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import app.aaps.plugins.main.di.PluginsModule
import app.aaps.plugins.source.di.SourceModule
import app.aaps.plugins.sync.di.OpenHumansModule
import app.aaps.plugins.sync.di.SyncModule
import app.aaps.pump.equil.di.EquilModule
import app.aaps.pump.virtual.di.VirtualPumpModule
import app.aaps.shared.impl.di.SharedImplModule
import app.aaps.ui.di.UiModule
Expand Down Expand Up @@ -76,6 +77,7 @@ import javax.inject.Singleton
DanaRSModule::class,
DiaconnG8Module::class,
EopatchModule::class,
EquilModule::class,
InsightModule::class,
InsightDatabaseModule::class,
MedtronicModule::class,
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/kotlin/app/aaps/di/PluginsListModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin
import app.aaps.plugins.sync.openhumans.OpenHumansUploaderPlugin
import app.aaps.plugins.sync.tidepool.TidepoolPlugin
import app.aaps.plugins.sync.xdrip.XdripPlugin
import app.aaps.pump.equil.EquilPumpPlugin
import app.aaps.pump.virtual.VirtualPumpPlugin
import dagger.Binds
import dagger.Module
Expand Down Expand Up @@ -221,9 +222,15 @@ abstract class PluginsListModule {
abstract fun bindMedtrumPlugin(plugin: MedtrumPlugin): PluginBase

@Binds
@AllConfigs
@PumpDriver
@IntoMap
@IntKey(170)
abstract fun bindEquilPumpPlugin(plugin: EquilPumpPlugin): PluginBase

@Binds
@AllConfigs
@IntoMap
@IntKey(180)
abstract fun bindVirtualPumpPlugin(plugin: VirtualPumpPlugin): PluginBase

@Binds
Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:8.2.1")
classpath("com.google.gms:google-services:4.4.0")
classpath("com.android.tools.build:gradle:8.4.0")
classpath("com.google.gms:google-services:4.4.1")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.9")

// NOTE: Do not place your application dependencies here; they belong
Expand Down Expand Up @@ -58,5 +58,5 @@ allprojects {
apply(from = "jacoco_aggregation.gradle.kts")

tasks.register<Delete>("clean").configure {
delete(rootProject.buildDir)
delete(rootProject.layout.buildDirectory)
}
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
object KtsBuildVersions {

const val gradle = "8.2.0"
const val kotlin = "1.9.10"
const val gradle = "8.4.0"
const val kotlin = "1.9.23"
}

plugins {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Libs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ object Libs {

object Kotlin {

const val kotlin = "1.9.10"
const val kotlin = "1.9.23"

const val stdlibJdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin"
const val reflect = "org.jetbrains.kotlin:kotlin-reflect:$kotlin"
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import org.gradle.api.JavaVersion

object Versions {

const val appVersion = "3.2.0.4"
const val appVersion = "3.2.1.0"
const val versionCode = 1500

const val ndkVersion = "21.1.6352462"
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/jacoco-app-dependencies.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ fun Project.registerCodeCoverageTask(
description = "Generate Jacoco coverage reports on the ${sourceName.replaceFirstChar(Char::titlecase)} build."

val javaDirectories = fileTree(
"${project.buildDir}/intermediates/classes/${sourcePath}"
layout.buildDirectory.dir("intermediates/classes/${sourcePath}")
) { exclude(excludedFiles) }

val kotlinDirectories = fileTree(
"${project.buildDir}/tmp/kotlin-classes/${sourcePath}"
layout.buildDirectory.dir("tmp/kotlin-classes/${sourcePath}")
) { exclude(excludedFiles) }

val coverageSrcDirectories = listOf(
Expand All @@ -137,7 +137,7 @@ fun Project.registerCodeCoverageTask(
additionalClassDirs.setFrom(files(coverageSrcDirectories))
sourceDirectories.setFrom(files(coverageSrcDirectories))
executionData.setFrom(
files("${project.buildDir}/jacoco/${testTaskName}.exec")
files(layout.buildDirectory.dir("jacoco/${testTaskName}.exec"))
)

reports {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ fun Project.registerCodeCoverageTask(
description = "Generate Jacoco coverage reports on the ${sourceName.replaceFirstChar(Char::titlecase)} build."

val javaDirectories = fileTree(
"${project.buildDir}/intermediates/classes/${sourcePath}"
layout.buildDirectory.dir("intermediates/classes/${sourcePath}")
) { exclude(excludedFiles) }

val kotlinDirectories = fileTree(
"${project.buildDir}/tmp/kotlin-classes/${sourcePath}"
layout.buildDirectory.dir("tmp/kotlin-classes/${sourcePath}")
) { exclude(excludedFiles) }

val coverageSrcDirectories = listOf(
Expand All @@ -137,7 +137,7 @@ fun Project.registerCodeCoverageTask(
additionalClassDirs.setFrom(files(coverageSrcDirectories))
sourceDirectories.setFrom(files(coverageSrcDirectories))
executionData.setFrom(
files("${project.buildDir}/jacoco/${testTaskName}.exec")
files(layout.buildDirectory.dir("jacoco/${testTaskName}.exec"))
)

reports {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ enum class ManufacturerType(val description: String) {
Roche("Roche"),
Ypsomed("Ypsomed"),
G2e("G2e"),
Eoflow("Eoflow");
Eoflow("Eoflow"),
Equil("Equil");
}
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,24 @@ enum class PumpType {
description = "Medtrum untested",
model = "untested",
parent = MEDTRUM_NANO
),
EQUIL(
description = "Equil",
manufacturer = ManufacturerType.Equil,
model = "Equil",
bolusSize = 0.05,
specialBolusSize = null,
extendedBolusSettings = DoseSettings(0.05, 30, 5 * 60, 0.05),
pumpTempBasalType = PumpTempBasalType.Absolute,
tbrSettings = DoseSettings(0.05, 30, 24 * 60, 0.0, 35.0),
specialBasalDurations = PumpCapability.BasalRate_Duration30minAllowed,
baseBasalMinValue = 0.05,
baseBasalMaxValue = 3.0,
baseBasalStep = 0.01,
baseBasalSpecialSteps = null,
pumpCapability = PumpCapability.DiaconnCapabilities,
source = Source.EQuil,
useHardwareLink = true,
);

val description: String
Expand Down Expand Up @@ -506,7 +524,8 @@ enum class PumpType {
Medtrum,
MDI,
VirtualPump,
Unknown
Unknown,
EQuil
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ fun PumpType.Companion.fromDbPumpType(pt: InterfaceIDs.PumpType): PumpType =
InterfaceIDs.PumpType.USER -> PumpType.USER
InterfaceIDs.PumpType.DIACONN_G8 -> PumpType.DIACONN_G8
InterfaceIDs.PumpType.EOPATCH2 -> PumpType.EOFLOW_EOPATCH2
InterfaceIDs.PumpType.EQUIL -> PumpType.EQUIL
InterfaceIDs.PumpType.MEDTRUM -> PumpType.MEDTRUM_NANO
InterfaceIDs.PumpType.MEDTRUM_300U -> PumpType.MEDTRUM_300U
InterfaceIDs.PumpType.MEDTRUM_UNTESTED -> PumpType.MEDTRUM_UNTESTED
Expand All @@ -84,6 +85,7 @@ fun PumpType.Source.toDbSource(): UserEntry.Sources =
PumpType.Source.Medtrum -> UserEntry.Sources.Medtrum
PumpType.Source.MDI -> UserEntry.Sources.MDI
PumpType.Source.VirtualPump -> UserEntry.Sources.VirtualPump
PumpType.Source.EQuil -> UserEntry.Sources.Equil
else -> UserEntry.Sources.Unknown
}

Expand Down Expand Up @@ -121,6 +123,7 @@ fun PumpType.toDbPumpType(): InterfaceIDs.PumpType =
PumpType.USER -> InterfaceIDs.PumpType.USER
PumpType.DIACONN_G8 -> InterfaceIDs.PumpType.DIACONN_G8
PumpType.EOFLOW_EOPATCH2 -> InterfaceIDs.PumpType.EOPATCH2
PumpType.EQUIL -> InterfaceIDs.PumpType.EQUIL
PumpType.MEDTRUM_NANO -> InterfaceIDs.PumpType.MEDTRUM
PumpType.MEDTRUM_300U -> InterfaceIDs.PumpType.MEDTRUM_300U
PumpType.MEDTRUM_UNTESTED -> InterfaceIDs.PumpType.MEDTRUM_UNTESTED
Expand Down
Binary file added core/ui/src/main/res/drawable/ic_equil_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ files:
translation: /pump/danar/src/main/res/values-%android_code%/strings.xml
- source: /pump/danars/src/main/res/values/strings.xml
translation: /pump/danars/src/main/res/values-%android_code%/strings.xml
- source: /pump/equil/src/main/res/values/strings.xml
translation: /pump/equil/src/main/res/values-%android_code%/strings.xml
- source: /pump/medtronic/src/main/res/values/strings.xml
translation: /pump/medtronic/src/main/res/values-%android_code%/strings.xml
- source: /pump/medtrum/src/main/res/values/strings.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ data class UserEntry(
OmnipodEros,
OmnipodDash, //No entry currently
EOPatch2,
Equil,
Medtrum,
MDI,
VirtualPump,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ data class InterfaceIDs @Ignore constructor(
MDI,
DIACONN_G8,
EOPATCH2,
EQUIL,
MEDTRUM,
MEDTRUM_300U,
MEDTRUM_UNTESTED,
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Sep 18 18:21:09 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class UserEntryPresentationHelperImpl @Inject constructor(
Sources.OmnipodEros -> R.drawable.ic_patch_pump_outline
Sources.OmnipodDash -> R.drawable.ic_patch_pump_outline
Sources.EOPatch2 -> app.aaps.core.ui.R.drawable.ic_eopatch2_128
Sources.Equil -> app.aaps.core.ui.R.drawable.ic_equil_128
Sources.Medtrum -> app.aaps.core.ui.R.drawable.ic_medtrum_128
Sources.MDI -> R.drawable.ic_ict
Sources.VirtualPump -> R.drawable.ic_virtual_pump
Expand Down
8 changes: 4 additions & 4 deletions jacoco_aggregation.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ project.afterEvaluate {
val classesDirectories = mutableListOf<String>().also {
subprojects.forEach { proj ->
variants.forEach { variant ->
it.add("${proj.buildDir}/intermediates/javac/$variant/classes")
it.add("${proj.buildDir}/tmp/kotlin-classes/$variant")
it.add("${proj.layout.buildDirectory}/intermediates/javac/$variant/classes")
it.add("${proj.layout.buildDirectory}/tmp/kotlin-classes/$variant")
}
}
}
Expand Down Expand Up @@ -71,12 +71,12 @@ project.afterEvaluate {
val executions = mutableListOf<String>().also {
subprojects.forEach { proj ->
variants.forEach { variant ->
val path = "${proj.buildDir}/outputs/unit_test_code_coverage/${variant}UnitTest/test${variant.replaceFirstChar(Char::titlecase)}UnitTest.exec"
val path = "${proj.layout.buildDirectory}/outputs/unit_test_code_coverage/${variant}UnitTest/test${variant.replaceFirstChar(Char::titlecase)}UnitTest.exec"
if ((File(path)).exists()) {
it.add(path)
println("Collecting execution data from: $path")
}
val androidPath = "${proj.buildDir}/outputs/code_coverage/${variant}AndroidTest/connected/"
val androidPath = "${proj.layout.buildDirectory}/outputs/code_coverage/${variant}AndroidTest/connected/"
val androidFiles = fileTree(androidPath)
androidFiles.forEach { file ->
it.add(file.path)
Expand Down
2 changes: 1 addition & 1 deletion plugins/constraints/src/main/res/xml/pref_safety.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:inputType="numberDecimal"
android:key="@string/key_treatmentssafety_maxbolus"
android:title="@string/max_bolus_title"
validate:floatmaxNumber="25.0"
validate:floatmaxNumber="60.0"
validate:floatminNumber="0.1"
validate:testType="floatNumericRange" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class SignatureVerifierPluginTest : TestBase() {
fun singleCharUnMapTest() {
@Suppress("SpellCheckingInspection") val key = "2ΙšÄΠΒϨÒÇeЄtЄЗž-*Ж*ZcHijЊÄœ<|x\"Ε"
val unmapped = singleCharUnMap(key)
assertThat(key.length).isEqualTo(32)
assertThat(unmapped).isEqualTo("32:99:61:C4:A0:92:E8:D2:C7:65:04:74:04:17:7E:2D:2A:16:2A:5A:63:48:69:6A:0A:C4:53:3C:7C:78:22:95")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class SmsCommunicatorPlugin @Inject constructor(
val commands = mapOf(
"BG" to "BG",
"LOOP" to "LOOP STOP/DISABLE/START/ENABLE/RESUME/STATUS/CLOSED/LGS\nLOOP SUSPEND 20",
"NSCLIENT" to "NSCLIENT RESTART",
"AAPSCLIENT" to "AAPSCLIENT RESTART",
"PUMP" to "PUMP\nPUMP CONNECT\nPUMP DISCONNECT 30\n",
"BASAL" to "BASAL STOP/CANCEL\nBASAL 0.3\nBASAL 0.3 20\nBASAL 30%\nBASAL 30% 20\n",
"BOLUS" to "BOLUS 1.2\nBOLUS 1.2 MEAL",
Expand Down Expand Up @@ -280,7 +280,7 @@ class SmsCommunicatorPlugin @Inject constructor(
else if (divided.size == 2 || divided.size == 3) processLOOP(divided, receivedSms)
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))

"NSCLIENT" ->
"AAPSCLIENT" ->
if (divided.size == 2) processNSCLIENT(divided, receivedSms)
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))

Expand Down Expand Up @@ -542,7 +542,7 @@ class SmsCommunicatorPlugin @Inject constructor(
private fun processNSCLIENT(divided: Array<String>, receivedSms: Sms) {
if (divided[1].uppercase(Locale.getDefault()) == "RESTART") {
rxBus.send(EventNSClientRestart())
sendSMS(Sms(receivedSms.phoneNumber, "NSCLIENT RESTART SENT"))
sendSMS(Sms(receivedSms.phoneNumber, "AAPSCLIENT RESTART SENT"))
receivedSms.processed = true
} else
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
Expand Down
Loading