diff --git a/app/src/main/java/info/nightscout/androidaps/implementations/ConfigImpl.kt b/app/src/main/java/info/nightscout/androidaps/implementations/ConfigImpl.kt index 41e1798d64..b3354a1aeb 100644 --- a/app/src/main/java/info/nightscout/androidaps/implementations/ConfigImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/implementations/ConfigImpl.kt @@ -9,12 +9,13 @@ import java.io.File import javax.inject.Inject import javax.inject.Singleton +@Suppress("KotlinConstantConditions") @Singleton class ConfigImpl @Inject constructor( fileListProvider: PrefFileListProvider ) : Config { - override val SUPPORTEDNSVERSION = 140206 // 14.2.6 + override val SUPPORTED_NS_VERSION = 140206 // 14.2.6 override val APS = BuildConfig.FLAVOR == "full" override val NSCLIENT = BuildConfig.FLAVOR == "aapsclient" || BuildConfig.FLAVOR == "aapsclient2" override val PUMPCONTROL = BuildConfig.FLAVOR == "pumpcontrol" diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/Config.kt b/core/interfaces/src/main/java/info/nightscout/interfaces/Config.kt index 5abe15d207..0bfee9e610 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/Config.kt +++ b/core/interfaces/src/main/java/info/nightscout/interfaces/Config.kt @@ -2,7 +2,7 @@ package info.nightscout.interfaces @Suppress("PropertyName") interface Config { - val SUPPORTEDNSVERSION: Int + val SUPPORTED_NS_VERSION: Int val APS: Boolean val NSCLIENT: Boolean val PUMPCONTROL: Boolean diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt index 4e60a09079..caf2c3979b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt @@ -1,3 +1,5 @@ +@file:Suppress("SpellCheckingInspection") + package info.nightscout.plugins.sync.nsclient.data import android.content.Context @@ -63,7 +65,7 @@ import javax.inject.Singleton "showForecast": "ar2", "focusHours": 3, "heartbeat": 60, - "baseURL": "http:\/\/barascgm.sysop.cz:82", + "baseURL": "http:\/\/xxxxxxxxxxxx", "authDefaultRoles": "readable", "thresholds": { "bgHigh": 252, @@ -150,7 +152,7 @@ class NSSettingsStatusImpl @Inject constructor( override fun handleNewData(status: JSONObject) { data = status aapsLogger.debug(LTag.NSCLIENT, "Got versions: Nightscout: ${getVersion()}") - if (getVersionNum() < config.SUPPORTEDNSVERSION) { + if (getVersionNum() < config.SUPPORTED_NS_VERSION) { uiInteraction.addNotification(Notification.OLD_NS, rh.gs(R.string.unsupported_ns_version), Notification.NORMAL) } else { rxBus.send(EventDismissNotification(Notification.OLD_NS)) @@ -177,7 +179,7 @@ class NSSettingsStatusImpl @Inject constructor( JsonHelper.safeGetJSONObject(data, "extendedSettings", null) // valid property is "warn" or "urgent" - // plugings "iage" "sage" "cage" "pbage" + // plugins "iage" "sage" "cage" "pbage" private fun getExtendedWarnValue(plugin: String, property: String): Double? { val extendedSettings = getExtendedSettings() ?: return null val pluginJson = extendedSettings.optJSONObject(plugin) ?: return null diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt index 377350f602..d1fbb8ff0f 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt @@ -17,7 +17,6 @@ import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton -@Suppress("SpellCheckingInspection") @Singleton class ProcessedDeviceStatusDataImpl @Inject constructor( private val rh: ResourceHelper, diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt index 39a7a04744..3eff83723b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -251,7 +251,7 @@ class NSClientV3Plugin @Inject constructor( private fun setClient() { nsAndroidClient = NSAndroidClientImpl( - baseUrl = sp.getString(info.nightscout.core.utils.R.string.key_nsclientinternal_url, "").lowercase().replace("https://", ""), + baseUrl = sp.getString(info.nightscout.core.utils.R.string.key_nsclientinternal_url, "").lowercase().replace("https://", "").replace(Regex("/$"), ""), accessToken = sp.getString(R.string.key_ns_client_token, ""), context = context, logging = true