Huawei: retrive and parse TruSleep data from new devices.

This commit is contained in:
Me7c7
2025-08-01 23:06:43 +02:00
committed by José Rebelo
parent f346de0cfb
commit 8bdb1b641e
17 changed files with 1103 additions and 111 deletions
@@ -58,7 +58,7 @@ public class GBDaoGenerator {
public static void main(String[] args) throws Exception {
final Schema schema = new Schema(107, MAIN_PACKAGE + ".entities");
final Schema schema = new Schema(108, MAIN_PACKAGE + ".entities");
Entity userAttributes = addUserAttributes(schema);
Entity user = addUserInfo(schema, userAttributes);
@@ -170,6 +170,8 @@ public class GBDaoGenerator {
addHuaweiActivitySample(schema, user, device);
addHuaweiStressSample(schema, user, device);
addHuaweiSleepStageSample(schema, user, device);
addHuaweiSleepStatsSample(schema, user, device);
addUltrahumanActivitySample(schema, user, device);
addUltrahumanDeviceStateSample(schema, user, device);
@@ -1548,6 +1550,36 @@ public class GBDaoGenerator {
return stressSample;
}
private static Entity addHuaweiSleepStageSample(Schema schema, Entity user, Entity device) {
Entity sleepStageSample = addEntity(schema, "HuaweiSleepStageSample");
addCommonTimeSampleProperties("AbstractTimeSample", sleepStageSample, user, device);
sleepStageSample.addIntProperty("stage").notNull();
return sleepStageSample;
}
private static Entity addHuaweiSleepStatsSample(Schema schema, Entity user, Entity device) {
Entity sample = addEntity(schema, "HuaweiSleepStatsSample");
sample.addImport(MAIN_PACKAGE + ".model.SleepScoreSample");
addCommonTimeSampleProperties("AbstractTimeSample", sample, user, device);
sample.implementsInterface("SleepScoreSample");
sample.addIntProperty("sleepScore").notNull().codeBeforeGetter(OVERRIDE);
sample.addLongProperty("bedTime").notNull();
sample.addLongProperty("risingTime").notNull();
sample.addLongProperty("wakeupTime").notNull();
sample.addIntProperty("sleepDataQuality").notNull();
sample.addIntProperty("deepPart").notNull();
sample.addIntProperty("snoreFreq").notNull();
sample.addIntProperty("sleepLatency").notNull();
sample.addIntProperty("sleepEfficiency").notNull();
sample.addIntProperty("minHeartRate").notNull();
sample.addIntProperty("maxHeartRate").notNull();
sample.addDoubleProperty("minOxygenSaturation").notNull();
sample.addDoubleProperty("maxOxygenSaturation").notNull();
sample.addDoubleProperty("minBreathRate").notNull();
sample.addDoubleProperty("maxBreathRate").notNull();
return sample;
}
private static Entity addHuaweiWorkoutSummarySample(Schema schema, Entity user, Entity device) {
Entity workoutSummary = addEntity(schema, "HuaweiWorkoutSummarySample");