mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
WeightScale: add btle profile and generic device coordinator / device support (#5225)
Adds support for receiving weights from standard Bluetooth Weight scales: 0000181d-0000-1000-8000-00805f9b34fb - org.bluetooth.service.weight_scale 00002a9d-0000-1000-8000-00805f9b34fb - org.bluetooth.characteristic.weight_measurement https://www.bluetooth.com/specifications/specs/weight-scale-service-1-0-1/
This commit is contained in:
committed by
José Rebelo
parent
7eaa5bb76b
commit
5b1a4b237b
@@ -58,7 +58,7 @@ public class GBDaoGenerator {
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
final Schema schema = new Schema(112, MAIN_PACKAGE + ".entities");
|
||||
final Schema schema = new Schema(113, MAIN_PACKAGE + ".entities");
|
||||
|
||||
Entity userAttributes = addUserAttributes(schema);
|
||||
Entity user = addUserInfo(schema, userAttributes);
|
||||
@@ -211,6 +211,7 @@ public class GBDaoGenerator {
|
||||
addGenericSleepStageSample(schema, user, device);
|
||||
addGenericTrainingLoadAcuteSample(schema, user, device);
|
||||
addGenericTrainingLoadChronicSample(schema, user, device);
|
||||
addGenericWeightSample(schema, user, device);
|
||||
|
||||
new DaoGenerator().generateAll(schema, "app/src/main/java");
|
||||
}
|
||||
@@ -1967,4 +1968,11 @@ public class GBDaoGenerator {
|
||||
sample.addIntProperty("value").notNull();
|
||||
return sample;
|
||||
}
|
||||
|
||||
private static Entity addGenericWeightSample(Schema schema, Entity user, Entity device) {
|
||||
Entity sample = addEntity(schema, "GenericWeightSample");
|
||||
addCommonTimeSampleProperties("AbstractWeightSample", sample, user, device);
|
||||
sample.addFloatProperty(SAMPLE_WEIGHT_KG).notNull().codeBeforeGetter(OVERRIDE);
|
||||
return sample;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user