diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt
index 60556e60da..d0267f0589 100644
--- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt
+++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt
@@ -171,6 +171,7 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
}
if (buildHelper.isEngineeringMode()) {
bluetoothStatusBinding.deliveryStatus.visibility = View.VISIBLE
+ bluetoothStatusBinding.connectionQuality.visibility = View.VISIBLE
}
podInfoBinding.omnipodCommonOverviewLotNumberLayout.visibility = View.GONE
podInfoBinding.omnipodCommonOverviewPodUniqueIdLayout.visibility = View.GONE
@@ -251,6 +252,21 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
private fun updateBluetoothStatus() {
bluetoothStatusBinding.omnipodDashBluetoothAddress.text = podStateManager.bluetoothAddress
?: PLACEHOLDER
+
+ val connectionSuccessPercentage = podStateManager.connectionSuccessRatio() * 100
+ val successPercentageString = String.format("%.2f %%", connectionSuccessPercentage)
+ val quality =
+ "${podStateManager.successfulConnections}/${podStateManager.connectionAttempts} :: $successPercentageString"
+ bluetoothStatusBinding.omnipodDashBluetoothConnectionQuality.text = quality
+ val connectionStatsColor = when {
+ connectionSuccessPercentage > 90 ->
+ Color.WHITE
+ connectionSuccessPercentage > 60 ->
+ Color.YELLOW
+ else ->
+ Color.RED
+ }
+ bluetoothStatusBinding.omnipodDashBluetoothConnectionQuality.setTextColor(connectionStatsColor)
bluetoothStatusBinding.omnipodDashDeliveryStatus.text = podStateManager.deliveryStatus?.let {
podStateManager.deliveryStatus.toString()
} ?: PLACEHOLDER
diff --git a/omnipod-dash/src/main/res/layout/omnipod_dash_overview_bluetooth_status.xml b/omnipod-dash/src/main/res/layout/omnipod_dash_overview_bluetooth_status.xml
index 23d31bbff5..04822f68d3 100644
--- a/omnipod-dash/src/main/res/layout/omnipod_dash_overview_bluetooth_status.xml
+++ b/omnipod-dash/src/main/res/layout/omnipod_dash_overview_bluetooth_status.xml
@@ -77,6 +77,46 @@
tools:ignore="HardcodedText" />
+
+
+
+
+
+
+
+
+