mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Huawei: Decode longest Streak and triped for jump rope(no UI)
This commit is contained in:
@@ -56,7 +56,7 @@ public class GBDaoGenerator {
|
|||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
final Schema schema = new Schema(102, MAIN_PACKAGE + ".entities");
|
final Schema schema = new Schema(103, MAIN_PACKAGE + ".entities");
|
||||||
|
|
||||||
Entity userAttributes = addUserAttributes(schema);
|
Entity userAttributes = addUserAttributes(schema);
|
||||||
Entity user = addUserInfo(schema, userAttributes);
|
Entity user = addUserInfo(schema, userAttributes);
|
||||||
@@ -1539,6 +1539,9 @@ public class GBDaoGenerator {
|
|||||||
workoutSummary.addByteProperty("algType").notNull();
|
workoutSummary.addByteProperty("algType").notNull();
|
||||||
workoutSummary.addIntProperty("trainingPoints").notNull();
|
workoutSummary.addIntProperty("trainingPoints").notNull();
|
||||||
|
|
||||||
|
workoutSummary.addIntProperty("longestStreak").notNull();
|
||||||
|
workoutSummary.addIntProperty("tripped").notNull();
|
||||||
|
|
||||||
return workoutSummary;
|
return workoutSummary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
package nodomain.freeyourgadget.gadgetbridge.database.schema;
|
||||||
|
|
||||||
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.database.DBUpdateScript;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.entities.HuaweiWorkoutSummarySampleDao;
|
||||||
|
|
||||||
|
public class GadgetbridgeUpdate_103 implements DBUpdateScript {
|
||||||
|
@Override
|
||||||
|
public void upgradeSchema(final SQLiteDatabase db) {
|
||||||
|
if (!DBHelper.existsColumn(HuaweiWorkoutSummarySampleDao.TABLENAME, HuaweiWorkoutSummarySampleDao.Properties.LongestStreak.columnName, db)) {
|
||||||
|
final String statement = "ALTER TABLE " + HuaweiWorkoutSummarySampleDao.TABLENAME + " ADD COLUMN \""
|
||||||
|
+ HuaweiWorkoutSummarySampleDao.Properties.LongestStreak.columnName + "\" INTEGER NOT NULL DEFAULT -1;";
|
||||||
|
db.execSQL(statement);
|
||||||
|
}
|
||||||
|
if (!DBHelper.existsColumn(HuaweiWorkoutSummarySampleDao.TABLENAME, HuaweiWorkoutSummarySampleDao.Properties.Tripped.columnName, db)) {
|
||||||
|
final String statement = "ALTER TABLE " + HuaweiWorkoutSummarySampleDao.TABLENAME + " ADD COLUMN \""
|
||||||
|
+ HuaweiWorkoutSummarySampleDao.Properties.Tripped.columnName + "\" INTEGER NOT NULL DEFAULT -1;";
|
||||||
|
db.execSQL(statement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void downgradeSchema(SQLiteDatabase database) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+7
@@ -186,6 +186,9 @@ public class Workout {
|
|||||||
|
|
||||||
public int trainingPoints = -1;
|
public int trainingPoints = -1;
|
||||||
|
|
||||||
|
public int longestStreak = -1;
|
||||||
|
public int tripped = -1;
|
||||||
|
|
||||||
public Response(ParamsProvider paramsProvider) {
|
public Response(ParamsProvider paramsProvider) {
|
||||||
super(paramsProvider);
|
super(paramsProvider);
|
||||||
}
|
}
|
||||||
@@ -272,6 +275,10 @@ public class Workout {
|
|||||||
this.runPaceZone4Time = container.getShort(0x59);
|
this.runPaceZone4Time = container.getShort(0x59);
|
||||||
if (container.contains(0x5a))
|
if (container.contains(0x5a))
|
||||||
this.runPaceZone5Time = container.getShort(0x5a);
|
this.runPaceZone5Time = container.getShort(0x5a);
|
||||||
|
if (container.contains(0x5b))
|
||||||
|
this.longestStreak = container.getAsInteger(0x5b);
|
||||||
|
if (container.contains(0x5c))
|
||||||
|
this.tripped = container.getAsInteger(0x5c);
|
||||||
if (container.contains(0x5d))
|
if (container.contains(0x5d))
|
||||||
this.algType = container.getByte(0x5d);
|
this.algType = container.getByte(0x5d);
|
||||||
if (container.contains(0x63))
|
if (container.contains(0x63))
|
||||||
|
|||||||
+3
-1
@@ -1903,7 +1903,9 @@ public class HuaweiSupportProvider {
|
|||||||
packet.runPaceZone4Time,
|
packet.runPaceZone4Time,
|
||||||
packet.runPaceZone5Time,
|
packet.runPaceZone5Time,
|
||||||
packet.algType,
|
packet.algType,
|
||||||
packet.trainingPoints
|
packet.trainingPoints,
|
||||||
|
packet.longestStreak,
|
||||||
|
packet.tripped
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user