Merge pull request #86 from 0pen-dash/avereha/omnipod_common_time_change_event_enabled
Fixed connection quality display
This commit is contained in:
commit
adb80d801c
2 changed files with 3 additions and 3 deletions
|
@ -628,9 +628,9 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
|
||||||
override fun connectionSuccessRatio(): Float {
|
override fun connectionSuccessRatio(): Float {
|
||||||
val attempts = connectionAttempts
|
val attempts = connectionAttempts
|
||||||
if (attempts == 0) {
|
if (attempts == 0) {
|
||||||
return 1.0F
|
return 0.0F
|
||||||
}
|
}
|
||||||
return successfulConnections.toFloat() * 100 / attempts.toFloat()
|
return successfulConnections.toFloat() / attempts.toFloat()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun reset() {
|
override fun reset() {
|
||||||
|
|
|
@ -244,7 +244,7 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
val connectionSuccessPercentage = podStateManager.connectionSuccessRatio() * 100
|
val connectionSuccessPercentage = podStateManager.connectionSuccessRatio() * 100
|
||||||
val successPercentageString = String.format("%.2f %%", podStateManager.connectionSuccessRatio())
|
val successPercentageString = String.format("%.2f %%", connectionSuccessPercentage)
|
||||||
val quality =
|
val quality =
|
||||||
"${podStateManager.successfulConnections}/${podStateManager.connectionAttempts} :: $successPercentageString"
|
"${podStateManager.successfulConnections}/${podStateManager.connectionAttempts} :: $successPercentageString"
|
||||||
bluetoothStatusBinding.omnipodDashBluetoothConnectionQuality.text = quality
|
bluetoothStatusBinding.omnipodDashBluetoothConnectionQuality.text = quality
|
||||||
|
|
Loading…
Reference in a new issue