Skip to content

Commit

Permalink
Merge pull request #3766 from nightscout/dev
Browse files Browse the repository at this point in the history
3.3.1.3
  • Loading branch information
MilosKozak authored Jan 20, 2025
2 parents 70e376f + 688ad1c commit dece928
Show file tree
Hide file tree
Showing 74 changed files with 1,269 additions and 170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
addAlertScreen(rootKey)
addPreferencesIfEnabled(maintenancePlugin, rootKey)
}
initSummary(preferenceScreen, pluginName != null)
try {
initSummary(preferenceScreen, pluginName != null)
} catch (_: Exception) {
throw Exception("Error in onCreatePreferences pluginName=$pluginName customPreference=$customPreference rootKey=$rootKey filter=$filter")
}
preprocessPreferences()
if (filter != "") updateFilterVisibility(filter, preferenceScreen)
}
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 @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget

object Versions {

const val appVersion = "3.3.1.2"
const val appVersion = "3.3.1.3"
const val versionCode = 1500

const val ndkVersion = "21.1.6352462"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ open class Notification {
const val MASTER_PASSWORD_NOT_SET = 90
const val DYN_ISF_FALLBACK = 91
const val AAPS_DIR_NOT_SELECTED = 92
const val EQUIL_ALARM = 93
const val EQUIL_ALARM_INSULIN = 94

const val USER_MESSAGE = 1000

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ sealed class EventData : Event() {
@Serializable
data class ActionUserActionConfirmed(val id: Int, val title: String) : EventData()

@Serializable
data class LoopStatesRequest(val timeStamp: Long) : EventData()

@Serializable
data class LoopStateSelected(val timeStamp: Long, val index: Int, val duration: Int? = null) : EventData()

@Serializable
data class LoopStateConfirmed(val timeStamp: Long, val index: Int, val duration: Int? = null) : EventData()

@Serializable
data class ActionHeartRate(
val duration: Long,
Expand Down Expand Up @@ -177,6 +186,37 @@ sealed class EventData : Event() {
@Serializable
data class OpenLoopRequestConfirmed(val timeStamp: Long) : EventData()

@Serializable
data class LoopStatesList(val timeStamp: Long, val states: List<AvailableLoopState>, val currentState: AvailableLoopState) : EventData() {
@Serializable
data class AvailableLoopState(
val state: LoopState,
val durations: List<Int>? = null,
val title: String? = null, // used for FAKE_DIVIDER
) {
@Serializable
enum class LoopState {
// See LoopDialog
LOOP_OPEN,
LOOP_LGS,
LOOP_CLOSED,

LOOP_DISABLE,
LOOP_ENABLE,

LOOP_SUSPEND, // 1h, 2h, 3h, 10h
LOOP_RESUME,

PUMP_DISCONNECT, // 15m, 30m, 1h, 2h, 3h
PUMP_RECONNECT,

// Returned current statuses
LOOP_UNKNOWN,
SUPERBOLUS,
}
}
}

// Mobile -> Wear
@Serializable
data class CancelNotification(val timeStamp: Long) : EventData()
Expand Down Expand Up @@ -366,4 +406,12 @@ sealed class EventData : Event() {

@Serializable
data class SnoozeAlert(val timeStamp: Long) : EventData()

// Wear -> Wear (workaround)
@Serializable
data class LoopStatePreSelect(
val timeStamp: Long,
val stateIndex: Int,
val durations: List<Int>
) : EventData()
}
1 change: 1 addition & 0 deletions core/interfaces/src/main/res/values-pl-rPL/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<string name="pref_show_ago">Pokaż Aktualność</string>
<string name="pref_show_week_number">Pokaż numer tygodnia</string>
<string name="pref_show_date">Pokaż Datę</string>
<string name="pref_show_seconds">Pokazuj Sekundy</string>
<string name="default_custom_watchface_comment">Domyślna tarcza, możesz kliknąć na EXPORTUJ TARCZĘ aby wygenerować szablon</string>
<string name="default_custom_watchface_external_comment">Domyślna tarcza zegarka, w tym zewnętrzne podglądy dla obserwujących. Możesz kliknąć na przycisk EKSPORT TARCZY aby wygenerować szablon</string>
<string name="wear_default_watchface">Domyślna Tarcza</string>
Expand Down
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ retrofit = "2.11.0"
kotlinx-serialization = "1.8.0"
kotlinx-coroutines = "1.10.1"
work = "2.10.0"
datastorePreferences = "1.1.1"
datastorePreferences = "1.1.2"
annotation = "1.9.1"

[plugins]
Expand All @@ -33,13 +33,13 @@ com-google-dagger-android-processor = { group = "com.google.dagger", name = "dag
com-google-dagger-android-support = { group = "com.google.dagger", name = "dagger-android-support", version.ref = "dagger" }

com-google-firebase-gradle = { group = "com.google.firebase", name = "firebase-crashlytics-gradle", version = "3.0.2" }
com-google-firebase-bom = { group = "com.google.firebase", name = "firebase-bom", version = "33.7.0" }
com-google-firebase-bom = { group = "com.google.firebase", name = "firebase-bom", version = "33.8.0" }
com-google-firebase-analytics = { group = "com.google.firebase", name = "firebase-analytics" }
com-google-firebase-crashlytics = { group = "com.google.firebase", name = "firebase-crashlytics" }
com-google-firebase-messaging = { group = "com.google.firebase", name = "firebase-messaging" }
com-google-firebase-auth = { group = "com.google.firebase", name = "firebase-auth" }
com-google-firebase-database = { group = "com.google.firebase", name = "firebase-database" }
com-google-android-gms-playservices-measurement = { group = "com.google.android.gms", name = "play-services-measurement-api", version = "22.1.2" }
com-google-android-gms-playservices-measurement = { group = "com.google.android.gms", name = "play-services-measurement-api", version = "22.2.0" }
com-google-android-gms-playservices-wearable = { group = "com.google.android.gms", name = "play-services-wearable", version = "19.0.0" }
com-google-android-gms-playservices-location = { group = "com.google.android.gms", name = "play-services-location", version = "21.3.0" }

Expand Down Expand Up @@ -75,7 +75,7 @@ kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-cor
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version = "0.6.1" }


androidx-activity = { group = "androidx.activity", name = "activity-ktx", version = "1.9.3" }
androidx-activity = { group = "androidx.activity", name = "activity-ktx", version = "1.10.0" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version = "1.7.0" }
androidx-biometric = { group = "androidx.biometric", name = "biometric", version = "1.1.0" }
androidx-browser = { group = "androidx.browser", name = "browser", version = "1.8.0" }
Expand Down Expand Up @@ -144,5 +144,5 @@ com-jakewharton-rx3-replaying-share = { group = "com.jakewharton.rx3", name = "r
commons-codec = { group = "commons-codec", name = "commons-codec", version = "1.17.2" }
com-github-guepardoapps-kulid = { group = "com.github.guepardoapps", name = "kulid", version = "2.0.0.0" }
com-thoughtworks-xstream = { group = "com.thoughtworks.xstream", name = "xstream", version = "1.4.21" }
com-garmin-connectiq = { group = "com.garmin.connectiq", name = "ciq-companion-app-sdk", version = "2.0.3" }
com-garmin-connectiq = { group = "com.garmin.connectiq", name = "ciq-companion-app-sdk", version = "2.2.0" }
androidx-annotation = { group = "androidx.annotation", name = "annotation", version.ref = "annotation" }
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,9 @@ class DetermineBasalSMB @Inject constructor(
// area of the /\ triangle is the same as a remainingCIpeak-height rectangle out to remainingCATime/2
// remainingCIpeak (mg/dL/5m) = remainingCarbs (g) * CSF (mg/dL/g) * 5 (m/5m) * 1h/60m / (remainingCATime/2) (h)
val remainingCIpeak = remainingCarbs * csf * 5 / 60 / (remainingCATime / 2)
if (remainingCIpeak.isNaN()) {
throw Exception("remainingCarbs=$remainingCarbs remainingCATime=$remainingCATime profile.remainingCarbsCap=${profile.remainingCarbsCap} csf=$csf")
}
//console.error(profile.min_5m_carbimpact,ci,totalCI,totalCA,remainingCarbs,remainingCI,remainingCATime);

// calculate peak deviation in last hour, and slope from that to current deviation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ class GarminPlugin @Inject constructor(
/** Returns glucose values in Nightscout/Xdrip format. */
@VisibleForTesting
fun onSgv(uri: URI): CharSequence {
receiveHeartRate(uri)
val count = getQueryParameter(uri, "count", 24L)
.toInt().coerceAtMost(1000).coerceAtLeast(1)
val briefMode = getQueryParameter(uri, "brief_mode", false)
Expand Down
Loading

0 comments on commit dece928

Please sign in to comment.