|
|
@ -20,6 +20,7 @@ import java.time.Instant |
|
|
|
import java.time.LocalDate |
|
|
|
import java.time.ZoneId |
|
|
|
import java.util.* |
|
|
|
import kotlin.math.roundToInt |
|
|
|
|
|
|
|
class Indigo2( |
|
|
|
private val indigoHost: String, |
|
|
@ -27,6 +28,7 @@ class Indigo2( |
|
|
|
private val oidcClientId: String, |
|
|
|
private val oidcClientSecret: String, |
|
|
|
private val autoClaim: Boolean, |
|
|
|
private val calorieScale: Double = 1.0, |
|
|
|
) : ExportTarget { |
|
|
|
private val om = jacksonObjectMapper().apply { |
|
|
|
configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) |
|
|
@ -162,7 +164,7 @@ class Indigo2( |
|
|
|
if (ws.time.seconds > 0) mapOf( |
|
|
|
"seconds" to ws.time.toInt(), |
|
|
|
"meters" to ws.distance?.toInt(), |
|
|
|
"calories" to ws.calories?.toInt(), |
|
|
|
"calories" to ws.calories?.toInt()?.let { (it * calorieScale).roundToInt() }, |
|
|
|
"resistance" to ws.level?.toInt(), |
|
|
|
"rpmSpeed" to ws.rpmSpeed?.toInt(), |
|
|
|
"pulse" to ws.pulse?.toInt(), |
|
|
|