Skip to content

Commit

Permalink
update processing of weight and height
Browse files Browse the repository at this point in the history
  • Loading branch information
hilpitome committed Dec 21, 2023
1 parent dc7df08 commit cdd80be
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ protected String getInputJsonString(Context context, JSONObject jsonObject, Widg
* Adding new calibration data here
*/
appendHealthData(optiBPData, widgetArgs);
optiBPData.put(OptibpConstants.CALIBRATION, getCalibrationData(Utils.decompress(optiBPData.optString(OptibpConstants.CALIBRATION),"UTF-8")));
optiBPData.put(OptibpConstants.CALIBRATION, getCalibrationData(optiBPData.optString(OptibpConstants.CALIBRATION)));
return optiBPData.toString();
}

Expand All @@ -355,8 +355,8 @@ private void appendHealthData(JSONObject returnObject, WidgetArgs widgetArgs) {
JSONObject currentHeight = getSingleStepJsonObject(widgetArgs, STEP1, OptibpConstants.HEIGHT);
JSONObject currentWeight = getSingleStepJsonObject(widgetArgs, STEP1, OptibpConstants.CURRENTWEIGHT);
if (currentHeight != null && currentWeight != null) {
returnObject.put(OptibpConstants.HEIGHT, Integer.parseInt(currentHeight.optString(VALUE)));
returnObject.put(OptibpConstants.WEIGHT, Integer.parseInt(currentWeight.optString(VALUE)));
returnObject.put(OptibpConstants.HEIGHT, (int) Double.parseDouble(currentHeight.optString(VALUE)));
returnObject.put(OptibpConstants.WEIGHT, (int) Double.parseDouble(currentWeight.optString(VALUE)));
}
} catch (JSONException e) {
Timber.e(e);
Expand Down

0 comments on commit cdd80be

Please sign in to comment.