体重使用稳定值,移除金额校验

This commit is contained in:
zxj
2025-07-10 15:32:38 +08:00
parent b657821b23
commit d92702a657
8 changed files with 66 additions and 37 deletions
@@ -33,7 +33,10 @@ object SensorScaleUtils {
else -> "未知"
}
// Timber.d("readWeight state = ${stateStr}, weight = $value")
callback?.invoke(value)
// 只使用稳定值
if (state == SensorScale.STATE_STABLE) {
callback?.invoke(value)
}
}
/**
@@ -66,7 +69,7 @@ object SensorScaleUtils {
if (open) {
if (autoScale) {
ThreadUtils.launchOnIo {
delay(2000)
delay(1000)
// 打开后需要等待后才能调用,否则会 1001 SDK未初始化
mSensorScale?.startContinuousRead()
}