diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/MedtrumPump.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/MedtrumPump.kt index f069dbea00..d6f46b2fea 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/MedtrumPump.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/MedtrumPump.kt @@ -183,7 +183,7 @@ class MedtrumPump @Inject constructor( var desiredHourlyMaxInsulin: Int = 40 var desiredDailyMaxInsulin: Int = 180 - fun loadFromSP() { + init { // Load stuff from SP _patchSessionToken = sp.getLong(R.string.key_session_token, 0L) _currentSequenceNumber = sp.getInt(R.string.key_current_sequence_number, 0) @@ -197,8 +197,6 @@ class MedtrumPump @Inject constructor( } catch (e: Exception) { aapsLogger.error(LTag.PUMP, "Error decoding basal profile from SP: $encodedString") } - - loadUserSettingsFromSP() } fun loadUserSettingsFromSP() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/services/MedtrumService.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/services/MedtrumService.kt index 659c3b397c..1f6a836c89 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/services/MedtrumService.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/services/MedtrumService.kt @@ -191,7 +191,7 @@ class MedtrumService : DaggerService(), BLECommCallback { } } - medtrumPump.loadFromSP() + medtrumPump.loadUserSettingsFromSP() } override fun onDestroy() {