initial battery level collector and simple chart

This commit is contained in:
vanous
2021-02-04 21:21:38 +01:00
parent 89e0799217
commit 3e04778696
8 changed files with 392 additions and 2 deletions
@@ -43,7 +43,7 @@ public class GBDaoGenerator {
public static void main(String[] args) throws Exception {
Schema schema = new Schema(32, MAIN_PACKAGE + ".entities");
Schema schema = new Schema(33, MAIN_PACKAGE + ".entities");
Entity userAttributes = addUserAttributes(schema);
Entity user = addUserInfo(schema, userAttributes);
@@ -90,7 +90,7 @@ public class GBDaoGenerator {
addNotificationFilterEntry(schema, notificationFilter);
addActivitySummary(schema, user, device);
addBatteryLevel(schema, device);
new DaoGenerator().generateAll(schema, "app/src/main/java");
}
@@ -604,4 +604,14 @@ public class GBDaoGenerator {
entity.addImport("de.greenrobot.dao.AbstractDao");
return entity;
}
private static Entity addBatteryLevel(Schema schema, Entity device) {
Entity batteryLevel = addEntity(schema, "BatteryLevel");
batteryLevel.implementsSerializable();
batteryLevel.addIntProperty("timestamp").notNull().primaryKey();
Property deviceId = batteryLevel.addLongProperty("deviceId").primaryKey().notNull().getProperty();
batteryLevel.addToOne(device, deviceId);
batteryLevel.addIntProperty("level").notNull();
return batteryLevel;
}
}