healbesdk / com.healbe.healbesdk.business_api.healthdata / HealthData / addWeight

addWeight

abstract fun addWeight(weight: HDWeight, precision: Int? = null): Completable

Add new weight.

If new weight is less or equal than current active goal weight than the goal will be updated to GoalStatus.REACHED status.

If there is the same weight in Health Data than IllegalArgumentException will be emitted.

Weight must be between ValidatorTool.WEIGHT_BOTTOM and ValidatorTool.WEIGHT_TOP. If weight is out of this bounds than IllegalArgumentException will be emitted.

precision will be used to round weight and check does it complete weight goal.

Parameters

weight - weight

precision - count of significant digits after point (optional)

Return
Completable that completes when weight is added

See Also

HDWeightGoal

abstract fun addWeight(weights: List<HDWeight>, precision: Int? = null): Completable

Add new weights.

If there is the same weight in Health Data than IllegalArgumentException will be emitted.

If any weight is less or equal than current active goal weight than the goal will be updated to GoalStatus.REACHED status.

All weights must be between ValidatorTool.WEIGHT_BOTTOM and ValidatorTool.WEIGHT_TOP. If weight is out of this bounds than IllegalArgumentException will be emitted.

precision will be used to round weights and check does it complete weight goal.

Parameters

weights - list of weights

precision - count of significant digits after point (optional)

Return
Completable that completes when weight is added

See Also

HDWeightGoal

addWeightWithSkip