1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-23 18:36:50 +01:00

Store not only device type, but also the model in the db

This commit is contained in:
cpfeiffer 2016-08-26 21:16:01 +02:00
parent c59553c9c9
commit 69f73467ea
2 changed files with 2 additions and 0 deletions

View File

@ -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);

View File

@ -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;