[PineTime][2481] Steps/Activity sync support #2481 (#2486)

added sync "steps" from PineTime/InfiniTime to Gadgetbridge.

notes:
* Steps sync works only since InfiniTime 1.7
* InfiniTime advertise "steps" info when the PineTime screen is ON (and a bit after that). hence:
	* you should unlock the PineTime screen before end of the day to not loose your latest progress (since the last unlock) at the end of the day;
	* when the PineTime screen is ON and you are moving, PineTime will send "steps" count every about 2-10 seconds, and Gadgetbridge may start to treat this data as an Activity (and also displaying it in Activity charts). that data and charts will not be accurate: you should wait for ["Health/Fitness data storage and expose to companion app](https://github.com/InfiniTimeOrg/InfiniTime/projects/4)" project to be implemented on the PineTime side. and meanwhile, in Gadgetbridge open "Device specific settings" and change/uncheck option in "Charts tabs" and "Activity info on device card" to leave only Steps data.

Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2486
Co-authored-by: ITCactus <itcactus@noreply.codeberg.org>
Co-committed-by: ITCactus <itcactus@noreply.codeberg.org>
This commit is contained in:
ITCactus
2021-12-11 21:19:05 +01:00
committed by Andreas Shimokawa
parent dfde2c8bdf
commit 4cadb0412b
5 changed files with 226 additions and 6 deletions
@@ -43,7 +43,7 @@ public class GBDaoGenerator {
public static void main(String[] args) throws Exception {
Schema schema = new Schema(35, MAIN_PACKAGE + ".entities");
Schema schema = new Schema(36, MAIN_PACKAGE + ".entities");
Entity userAttributes = addUserAttributes(schema);
Entity user = addUserInfo(schema, userAttributes);
@@ -81,6 +81,7 @@ public class GBDaoGenerator {
addBangleJSActivitySample(schema, user, device);
addCasioGBX100Sample(schema, user, device);
addFitProActivitySample(schema, user, device);
addPineTimeActivitySample(schema, user, device);
addHybridHRActivitySample(schema, user, device);
addCalendarSyncState(schema, device);
@@ -633,4 +634,13 @@ public class GBDaoGenerator {
return activitySample;
}
private static Entity addPineTimeActivitySample(Schema schema, Entity user, Entity device) {
Entity activitySample = addEntity(schema, "PineTimeActivitySample");
activitySample.implementsSerializable();
addCommonActivitySampleProperties("AbstractActivitySample", activitySample, user, device);
activitySample.addIntProperty(SAMPLE_RAW_KIND).notNull().codeBeforeGetterAndSetter(OVERRIDE);
activitySample.addIntProperty(SAMPLE_STEPS).notNull().codeBeforeGetterAndSetter(OVERRIDE);
addHeartRateProperties(activitySample);
return activitySample;
}
}