Add muscle mass and bone mass to Withings download

Fixes #3497
This commit is contained in:
Ale Martinez
2020-06-30 19:01:50 -03:00
parent c2abdc2a5b
commit 709994c3e7
2 changed files with 8 additions and 8 deletions

View File

@@ -200,6 +200,8 @@ WithingsDownload::parse(QString text, QList<BodyMeasure> &bodyMeasures)
w.fatkg = r.fatkg;
w.leankg = r.leankg;
w.fatpercent = r.fatpercent;
w.musclekg = r.musclekg;
w.boneskg = r.boneskg;
w.source = BodyMeasure::Withings;
bodyMeasures.append(w);
}
@@ -251,6 +253,8 @@ WithingsDownload::jsonDocumentToWithingsReading(QJsonDocument doc) {
case 5 : thisReading.leankg = value; break;
case 6 : thisReading.fatpercent = value; break;
case 8 : thisReading.fatkg = value; break;
case 76: thisReading.musclekg = value; break;
case 88: thisReading.boneskg = value; break;
default: break;
}
}

View File

@@ -31,17 +31,11 @@
// found here http://www.withings.com/en/api/bodyscale
//
#define WITHINGS_WEIGHT 0
#define WITHINGS_FATKG 1
#define WITHINGS_FATPERCENT 2
#define WITHINGS_LEANKG 3
#define WITHINGS_HEIGHT 4
class WithingsReading {
public:
WithingsReading() : category(0), groupId(0), attribution(0), when(QDateTime()), comment(""),
weightkg(0), fatkg(0), leankg(0), fatpercent(0), sizemeter(0) {}
weightkg(0), fatkg(0), leankg(0), fatpercent(0), sizemeter(0), musclekg(0), boneskg(0) {}
int category; // 1 = target, 2 = measurement
int groupId; // serialized for synchronizing
@@ -54,7 +48,9 @@ public:
fatkg, // fat in Kilograms
leankg, // lean mass in Kilograms
fatpercent, // body fat as a percentage of weight
sizemeter; // height ?
sizemeter, // height
musclekg, // muscle mass (kg)
boneskg; // bone mass (kg)
// used by qSort()
bool operator< (WithingsReading right) const {