From 69f73467ea00e174914b640757ff40238b688c95 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Fri, 26 Aug 2016 21:16:01 +0200 Subject: [PATCH] Store not only device type, but also the model in the db --- .../freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java | 1 + .../nodomain/freeyourgadget/gadgetbridge/database/DBHelper.java | 1 + 2 files changed, 2 insertions(+) diff --git a/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java b/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java index d47f698db..11feaa159 100644 --- a/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java +++ b/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java @@ -112,6 +112,7 @@ public class GBDaoGenerator { device.addStringProperty("manufacturer").notNull(); device.addStringProperty("identifier").notNull().unique().javaDocGetterAndSetter("The fixed identifier, i.e. MAC address of the device."); device.addIntProperty("type").notNull().javaDocGetterAndSetter("The DeviceType key, i.e. the GBDevice's type."); + device.addStringProperty("model").javaDocGetterAndSetter("An optional model, further specifying the kind of device-"); Property deviceId = deviceAttributes.addLongProperty("deviceId").notNull().getProperty(); // sorted by the from-date, newest first Property deviceAttributesSortProperty = getPropertyByName(deviceAttributes, VALID_FROM_UTC); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/DBHelper.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/DBHelper.java index 198302913..4490510b7 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/DBHelper.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/DBHelper.java @@ -302,6 +302,7 @@ public class DBHelper { DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(gbDevice); device.setManufacturer(coordinator.getManufacturer()); device.setType(gbDevice.getType().getKey()); + device.setModel(gbDevice.getModel()); session.getDeviceDao().insert(device); return device;