Fix wrong notifications, and error on load
This commit is contained in:
parent
49de6a9c32
commit
3a33f46e2f
2 changed files with 2 additions and 4 deletions
|
@ -183,7 +183,7 @@ class MedtrumPump @Inject constructor(
|
||||||
var desiredHourlyMaxInsulin: Int = 40
|
var desiredHourlyMaxInsulin: Int = 40
|
||||||
var desiredDailyMaxInsulin: Int = 180
|
var desiredDailyMaxInsulin: Int = 180
|
||||||
|
|
||||||
fun loadFromSP() {
|
init {
|
||||||
// Load stuff from SP
|
// Load stuff from SP
|
||||||
_patchSessionToken = sp.getLong(R.string.key_session_token, 0L)
|
_patchSessionToken = sp.getLong(R.string.key_session_token, 0L)
|
||||||
_currentSequenceNumber = sp.getInt(R.string.key_current_sequence_number, 0)
|
_currentSequenceNumber = sp.getInt(R.string.key_current_sequence_number, 0)
|
||||||
|
@ -197,8 +197,6 @@ class MedtrumPump @Inject constructor(
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
aapsLogger.error(LTag.PUMP, "Error decoding basal profile from SP: $encodedString")
|
aapsLogger.error(LTag.PUMP, "Error decoding basal profile from SP: $encodedString")
|
||||||
}
|
}
|
||||||
|
|
||||||
loadUserSettingsFromSP()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun loadUserSettingsFromSP() {
|
fun loadUserSettingsFromSP() {
|
||||||
|
|
|
@ -191,7 +191,7 @@ class MedtrumService : DaggerService(), BLECommCallback {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
medtrumPump.loadFromSP()
|
medtrumPump.loadUserSettingsFromSP()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
|
|
Loading…
Reference in a new issue