Skip to content

Commit 8e7201b

Browse files
committed
Add ProteinMass, BodyScore and Height to expr
1 parent 4a9d274 commit 8e7201b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

internal/expr.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ func Expr(config map[string]string, weights []*core.Weight) error {
1919
switch key {
2020
case "Date":
2121
opt = expr.AsAny()
22-
case "Weight", "BMI", "BodyFat", "BodyWater", "BoneMass", "MuscleMass", "SkeletalMuscleMass":
22+
case "Weight", "BMI", "BodyFat", "BodyWater", "BoneMass", "MuscleMass", "ProteinMass", "Height", "SkeletalMuscleMass":
2323
opt = expr.AsFloat64()
24-
case "MetabolicAge", "PhysiqueRating", "VisceralFat", "BasalMetabolism", "HeartRate":
24+
case "MetabolicAge", "PhysiqueRating", "VisceralFat", "BasalMetabolism", "BodyScore", "HeartRate":
2525
opt = expr.AsInt()
2626
case "User", "Source":
2727
opt = expr.AsKind(reflect.String)
@@ -65,12 +65,18 @@ func Expr(config map[string]string, weights []*core.Weight) error {
6565
weight.MuscleMass = float32(v.(float64))
6666
case "PhysiqueRating":
6767
weight.PhysiqueRating = v.(int)
68+
case "ProteinMass":
69+
weight.ProteinMass = float32(v.(float64))
6870
case "VisceralFat":
6971
weight.VisceralFat = v.(int)
7072
case "BasalMetabolism":
7173
weight.BasalMetabolism = v.(int)
74+
case "BodyScore":
75+
weight.BodyScore = v.(int)
7276
case "HeartRate":
7377
weight.HeartRate = v.(int)
78+
case "Height":
79+
weight.Height = float32(v.(float64))
7480
case "SkeletalMuscleMass":
7581
weight.SkeletalMuscleMass = float32(v.(float64))
7682
case "User":

0 commit comments

Comments
 (0)