mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Store not only device type, but also the model in the db
This commit is contained in:
@@ -112,6 +112,7 @@ public class GBDaoGenerator {
|
|||||||
device.addStringProperty("manufacturer").notNull();
|
device.addStringProperty("manufacturer").notNull();
|
||||||
device.addStringProperty("identifier").notNull().unique().javaDocGetterAndSetter("The fixed identifier, i.e. MAC address of the device.");
|
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.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();
|
Property deviceId = deviceAttributes.addLongProperty("deviceId").notNull().getProperty();
|
||||||
// sorted by the from-date, newest first
|
// sorted by the from-date, newest first
|
||||||
Property deviceAttributesSortProperty = getPropertyByName(deviceAttributes, VALID_FROM_UTC);
|
Property deviceAttributesSortProperty = getPropertyByName(deviceAttributes, VALID_FROM_UTC);
|
||||||
|
|||||||
@@ -302,6 +302,7 @@ public class DBHelper {
|
|||||||
DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(gbDevice);
|
DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(gbDevice);
|
||||||
device.setManufacturer(coordinator.getManufacturer());
|
device.setManufacturer(coordinator.getManufacturer());
|
||||||
device.setType(gbDevice.getType().getKey());
|
device.setType(gbDevice.getType().getKey());
|
||||||
|
device.setModel(gbDevice.getModel());
|
||||||
session.getDeviceDao().insert(device);
|
session.getDeviceDao().insert(device);
|
||||||
|
|
||||||
return device;
|
return device;
|
||||||
|
|||||||
Reference in New Issue
Block a user