- Redo Pod expiry datetime based on activation time
This commit is contained in:
parent
3ed9cd0f78
commit
b82d9cf457
1 changed files with 4 additions and 5 deletions
|
@ -203,10 +203,9 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
|
||||||
// TODO: Consider storing expiry datetime in pod state saving continuesly recalculating to the same value
|
// TODO: Consider storing expiry datetime in pod state saving continuesly recalculating to the same value
|
||||||
get() {
|
get() {
|
||||||
val podLifeInHours = podLifeInHours
|
val podLifeInHours = podLifeInHours
|
||||||
val minutesSinceActivation = minutesSinceActivation
|
val activationTime = podState.activationTime
|
||||||
if (podLifeInHours != null && minutesSinceActivation != null) {
|
if (podLifeInHours != null && activationTime != null) {
|
||||||
val expiresInMinutes = podLifeInHours * 60 - minutesSinceActivation
|
return DateTime(podState.activationTime).plusHours(podLifeInHours.toInt())
|
||||||
return DateTime().plusMinutes(expiresInMinutes)
|
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
@ -601,7 +600,7 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
|
||||||
var ltk: ByteArray? = null
|
var ltk: ByteArray? = null
|
||||||
var eapAkaSequenceNumber: Long = 1
|
var eapAkaSequenceNumber: Long = 1
|
||||||
var bolusPulsesRemaining: Short = 0
|
var bolusPulsesRemaining: Short = 0
|
||||||
var timeZone: String = "" // DateTimeZone.getDefault()
|
var timeZone: String = "" // TimeZone ID (e.g. "Europe/Amsterdam")
|
||||||
|
|
||||||
var bleVersion: SoftwareVersion? = null
|
var bleVersion: SoftwareVersion? = null
|
||||||
var firmwareVersion: SoftwareVersion? = null
|
var firmwareVersion: SoftwareVersion? = null
|
||||||
|
|
Loading…
Reference in a new issue