fix tests
This commit is contained in:
parent
2326be8c7a
commit
da76506e01
1 changed files with 3 additions and 2 deletions
|
@ -82,8 +82,9 @@ internal fun RemoteTreatment.toTreatment(): NSTreatment? {
|
||||||
if (treatmentTimestamp == 0L) return null
|
if (treatmentTimestamp == 0L) return null
|
||||||
|
|
||||||
this.duration ?: return null
|
this.duration ?: return null
|
||||||
|
val durationInMilliseconds = this.durationInMilliseconds ?: TimeUnit.MINUTES.toMillis(this.duration)
|
||||||
|
|
||||||
if (duration == 0L)
|
if (durationInMilliseconds == 0L)
|
||||||
return NSTemporaryTarget(
|
return NSTemporaryTarget(
|
||||||
date = treatmentTimestamp,
|
date = treatmentTimestamp,
|
||||||
device = this.device,
|
device = this.device,
|
||||||
|
@ -127,7 +128,7 @@ internal fun RemoteTreatment.toTreatment(): NSTreatment? {
|
||||||
endId = this.endId,
|
endId = this.endId,
|
||||||
pumpType = this.pumpType,
|
pumpType = this.pumpType,
|
||||||
pumpSerial = this.pumpSerial,
|
pumpSerial = this.pumpSerial,
|
||||||
duration = this.durationInMilliseconds ?: TimeUnit.MINUTES.toMillis(this.duration),
|
duration = durationInMilliseconds,
|
||||||
targetBottom = this.targetBottom,
|
targetBottom = this.targetBottom,
|
||||||
targetTop = this.targetTop,
|
targetTop = this.targetTop,
|
||||||
reason = NSTemporaryTarget.Reason.fromString(this.reason)
|
reason = NSTemporaryTarget.Reason.fromString(this.reason)
|
||||||
|
|
Loading…
Reference in a new issue