Skip to content

Commit 9b0809e

Browse files
committed
Fix Fitbit Activity API parsing
Fixes activityLevel Fixes manual settings calories
1 parent 3f94b8c commit 9b0809e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kafka-connect-fitbit-source/src/main/java/org/radarbase/connect/rest/fitbit/converter/FitbitActivityLogAvroConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private FitbitSource getSource(JsonNode s) {
115115
}
116116

117117
private FitbitActivityLevels getActivityLevels(JsonNode s) {
118-
return optArray(s, "activityLevels")
118+
return optArray(s, "activityLevel")
119119
.map(levels -> {
120120
FitbitActivityLevels.Builder activityLevels = FitbitActivityLevels.newBuilder();
121121
for (JsonNode level : levels) {
@@ -147,7 +147,7 @@ private FitbitManualDataEntry getManualDataEntry(JsonNode s) {
147147
.map(manual -> FitbitManualDataEntry.newBuilder()
148148
.setSteps(optBoolean(manual, "steps").orElse(null))
149149
.setDistance(optBoolean(manual, "distance").orElse(null))
150-
.setEnergy(optBoolean(manual, "calorie").orElse(null))
150+
.setEnergy(optBoolean(manual, "calories").orElse(null))
151151
.build())
152152
.orElse(null);
153153
}

0 commit comments

Comments
 (0)