2015-08-03 23:09:49 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.model;
|
2015-05-05 00:48:02 +02:00
|
|
|
|
2015-10-26 23:32:03 +01:00
|
|
|
/**
|
|
|
|
* For every supported device, a device type constant must exist.
|
2016-08-17 00:34:19 +02:00
|
|
|
*
|
|
|
|
* Note: they key of every constant is stored in the DB, so it is fixed forever,
|
|
|
|
* and may not be changed.
|
2015-10-26 23:32:03 +01:00
|
|
|
*/
|
2015-05-05 00:48:02 +02:00
|
|
|
public enum DeviceType {
|
2016-08-17 00:34:19 +02:00
|
|
|
UNKNOWN(-1),
|
|
|
|
PEBBLE(1),
|
|
|
|
MIBAND(10),
|
|
|
|
MIBAND2(11),
|
2016-09-19 12:37:41 +02:00
|
|
|
VIBRATISSIMO(20),
|
2016-08-17 00:34:19 +02:00
|
|
|
TEST(1000);
|
|
|
|
|
|
|
|
private final int key;
|
|
|
|
|
|
|
|
DeviceType(int key) {
|
|
|
|
this.key = key;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getKey() {
|
|
|
|
return key;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static DeviceType fromKey(int key) {
|
|
|
|
for (DeviceType type : values()) {
|
|
|
|
if (type.key == key) {
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return DeviceType.UNKNOWN;
|
|
|
|
}
|
2015-05-05 00:48:02 +02:00
|
|
|
}
|