mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-11 12:39:26 +01:00
Use GBDeviceCandidate#getName on all coordinators
This commit is contained in:
parent
6f7fb261e7
commit
a85246c279
@ -72,7 +72,7 @@ public class BangleJSCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
/* Filter by Espruino devices to avoid getting
|
||||
the device chooser full of spam devices. */
|
||||
if (name != null && (
|
||||
|
@ -47,7 +47,7 @@ public class CasioGB6900DeviceCoordinator extends CasioDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null) {
|
||||
if (name.startsWith("CASIO") && (name.contains("6900B") || name.contains("5600B") ||
|
||||
name.contains("STB-1000"))) {
|
||||
|
@ -51,7 +51,7 @@ public class CasioGBX100DeviceCoordinator extends CasioDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null) {
|
||||
if (name.startsWith("CASIO") && (name.endsWith("GBX-100") ||
|
||||
name.endsWith("GBD-200") || name.endsWith("GBD-100") ||
|
||||
|
@ -30,7 +30,7 @@ public class CasioGMWB5000DeviceCoordinator extends CasioGWB5600DeviceCoordinato
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null) {
|
||||
if (name.equals("CASIO GMW-B5000")) {
|
||||
return DeviceType.CASIOGMWB5000;
|
||||
|
@ -49,7 +49,7 @@ public class CasioGWB5600DeviceCoordinator extends CasioDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null) {
|
||||
if (name.equals("CASIO GW-B5600")) {
|
||||
return DeviceType.CASIOGWB5600;
|
||||
|
@ -42,7 +42,7 @@ public class DomyosT540Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.startsWith("Domyos-TC-9610")) {
|
||||
return DeviceType.DOMYOS_T540;
|
||||
}
|
||||
|
@ -18,7 +18,6 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.fitpro;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelUuid;
|
||||
@ -63,8 +62,7 @@ public class FitProDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
|
||||
if (name != null && (
|
||||
name.startsWith("M6") ||
|
||||
|
@ -33,7 +33,7 @@ public class EXRIZUK8Coordinator extends HPlusCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if(name != null && name.startsWith("iRun ")){
|
||||
return DeviceType.EXRIZUK8;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class HPlusCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.startsWith("HPLUS")) {
|
||||
return DeviceType.HPLUS;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class MakibesF68Coordinator extends HPlusCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if(name != null && name.startsWith("SPORT") && !name.startsWith("SPORTAGE")){
|
||||
return DeviceType.MAKIBESF68;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class Q8Coordinator extends HPlusCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if(name != null && name.startsWith("Q8")){
|
||||
return DeviceType.Q8;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class SG2Coordinator extends HPlusCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.startsWith("SG2")) {
|
||||
HPlusCoordinator.setNotificationLinesNumber(candidate.getDevice().getAddress(), 9);
|
||||
HPlusCoordinator.setUnicodeSupport(candidate.getDevice().getAddress(), true);
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitband5;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -48,8 +47,7 @@ public class AmazfitBand5Coordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase(HuamiConst.AMAZFIT_BAND5_NAME)) {
|
||||
return DeviceType.AMAZFITBAND5;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitband7;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -41,8 +40,7 @@ public class AmazfitBand7Coordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_BAND7_NAME)) {
|
||||
return DeviceType.AMAZFITBAND7;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class AmazfitBipCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && (name.equalsIgnoreCase("Amazfit Bip Watch"))) {
|
||||
return DeviceType.AMAZFITBIP;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -46,8 +45,7 @@ public class AmazfitBipLiteCoordinator extends AmazfitBipCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Amazfit Bip Lite")) {
|
||||
return DeviceType.AMAZFITBIP_LITE;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip3pro;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -46,8 +45,7 @@ public class AmazfitBip3ProCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Amazfit Bip 3 Pro")) {
|
||||
return DeviceType.AMAZFITBIP3PRO;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip5;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -52,8 +51,7 @@ public class AmazfitBip5Coordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_BIP5_NAME)) {
|
||||
return DeviceType.AMAZFITBIP5;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbips;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class AmazfitBipSCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && (name.equalsIgnoreCase("Amazfit Bip S"))) {
|
||||
return DeviceType.AMAZFITBIPS;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbips;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -44,8 +43,7 @@ public class AmazfitBipSLiteCoordinator extends AmazfitBipSCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && (name.equalsIgnoreCase("Bip S Lite"))) {
|
||||
return DeviceType.AMAZFITBIPS_LITE;
|
||||
}
|
||||
|
@ -18,7 +18,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbipu;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -48,8 +47,7 @@ public class AmazfitBipUCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && (name.equalsIgnoreCase("Amazfit Bip U"))) {
|
||||
return DeviceType.AMAZFITBIPU;
|
||||
}
|
||||
|
@ -18,7 +18,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbipupro;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -48,8 +47,7 @@ public class AmazfitBipUProCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && (name.equalsIgnoreCase("Amazfit Bip U Pro"))) {
|
||||
return DeviceType.AMAZFITBIPUPRO;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitcheetahpro;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -41,8 +40,7 @@ public class AmazfitCheetahProCoordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_CHEETAH_PRO_NAME)) {
|
||||
return DeviceType.AMAZFITCHEETAHPRO;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitcheetahround;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -52,8 +51,7 @@ public class AmazfitCheetahRoundCoordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_CHEETAH_ROUND_NAME)) {
|
||||
return DeviceType.AMAZFITCHEETAHROUND;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitcheetahsquare;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -52,8 +51,7 @@ public class AmazfitCheetahSquareCoordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_CHEETAH_SQUARE_NAME)) {
|
||||
return DeviceType.AMAZFITCHEETAHSQUARE;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitcor;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class AmazfitCorCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && (name.equalsIgnoreCase("Amazfit Band") || name.equalsIgnoreCase("Amazfit Cor"))) {
|
||||
return DeviceType.AMAZFITCOR;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitcor2;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class AmazfitCor2Coordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && (name.equalsIgnoreCase("Amazfit Band 2") || name.equalsIgnoreCase("Amazfit Cor 2"))) {
|
||||
return DeviceType.AMAZFITCOR2;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitfalcon;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -52,8 +51,7 @@ public class AmazfitFalconCoordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_FALCON_NAME)) {
|
||||
return DeviceType.AMAZFITFALCON;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class AmazfitGTRCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Amazfit GTR")) {
|
||||
return DeviceType.AMAZFITGTR;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class AmazfitGTRLiteCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Amazfit GTR L")) {
|
||||
return DeviceType.AMAZFITGTR_LITE;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class AmazfitGTR2Coordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Amazfit GTR 2")) {
|
||||
return DeviceType.AMAZFITGTR2;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class AmazfitGTR2eCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Amazfit GTR 2e")) {
|
||||
return DeviceType.AMAZFITGTR2E;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr3;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -41,8 +40,7 @@ public class AmazfitGTR3Coordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_GTR3_NAME) && !name.contains("Pro")) {
|
||||
return DeviceType.AMAZFITGTR3;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr3pro;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -41,8 +40,7 @@ public class AmazfitGTR3ProCoordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_GTR3_PRO_NAME)) {
|
||||
return DeviceType.AMAZFITGTR3PRO;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr4;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -41,8 +40,7 @@ public class AmazfitGTR4Coordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_GTR4_NAME)) {
|
||||
return DeviceType.AMAZFITGTR4;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtrmini;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class AmazfitGTRMiniCoordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_GTR_MINI_NAME)) {
|
||||
return DeviceType.AMAZFITGTRMINI;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -46,8 +45,7 @@ public class AmazfitGTSCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Amazfit GTS")) {
|
||||
return DeviceType.AMAZFITGTS;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts2;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class AmazfitGTS2Coordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Amazfit GTS 2")) {
|
||||
return DeviceType.AMAZFITGTS2;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts2;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -46,8 +45,7 @@ public class AmazfitGTS2MiniCoordinator extends AmazfitGTS2Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Amazfit GTS2 mini")) {
|
||||
return DeviceType.AMAZFITGTS2_MINI;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts2;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class AmazfitGTS2eCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Amazfit GTS 2e")) {
|
||||
return DeviceType.AMAZFITGTS2E;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts3;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -41,8 +40,7 @@ public class AmazfitGTS3Coordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_GTS3_NAME)) {
|
||||
return DeviceType.AMAZFITGTS3;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts4;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -41,8 +40,7 @@ public class AmazfitGTS4Coordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_GTS4_NAME) && !name.contains("Mini")) {
|
||||
return DeviceType.AMAZFITGTS4;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts4mini;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -41,8 +40,7 @@ public class AmazfitGTS4MiniCoordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_GTS4_MINI_NAME)) {
|
||||
return DeviceType.AMAZFITGTS4MINI;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitneo;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -51,8 +50,7 @@ public class AmazfitNeoCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase(HuamiConst.AMAZFIT_NEO_NAME)) {
|
||||
return DeviceType.AMAZFITNEO;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitpop;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -44,8 +43,7 @@ public class AmazfitPopCoordinator extends AmazfitBipUCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && (name.equalsIgnoreCase("Amazfit Pop"))) {
|
||||
return DeviceType.AMAZFITPOP;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitpoppro;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -44,8 +43,7 @@ public class AmazfitPopProCoordinator extends AmazfitBipUProCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && (name.equalsIgnoreCase("Amazfit Pop Pro"))) {
|
||||
return DeviceType.AMAZFITPOPPRO;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfittrex;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class AmazfitTRexCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Amazfit T-Rex")) {
|
||||
return DeviceType.AMAZFITTREX;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfittrex2;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -41,8 +40,7 @@ public class AmazfitTRex2Coordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_TREX_2_NAME)) {
|
||||
return DeviceType.AMAZFITTREX2;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfittrexpro;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class AmazfitTRexProCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Amazfit T-Rex Pro")) {
|
||||
return DeviceType.AMAZFITTREXPRO;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfittrexultra;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -52,8 +51,7 @@ public class AmazfitTRexUltraCoordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.AMAZFIT_TREX_ULTRA)) {
|
||||
return DeviceType.AMAZFITTREXULTRA;
|
||||
}
|
||||
|
@ -46,8 +46,7 @@ public class AmazfitVergeLCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Amazfit Verge L")) {
|
||||
return DeviceType.AMAZFITVERGEL;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitx;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -49,8 +48,7 @@ public class AmazfitXCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase(HuamiConst.AMAZFIT_X)) {
|
||||
return DeviceType.AMAZFITX;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.miband2;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -51,8 +50,7 @@ public class MiBand2Coordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase(HuamiConst.MI_BAND2_NAME)) {
|
||||
return DeviceType.MIBAND2;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.miband2;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -27,7 +26,7 @@ import org.slf4j.LoggerFactory;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
z
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
|
||||
@ -51,8 +50,7 @@ public class MiBand2HRXCoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (HuamiConst.MI_BAND2_NAME_HRX.equalsIgnoreCase(name) || "Mi Band 2i".equalsIgnoreCase(name)) {
|
||||
return DeviceType.MIBAND2_HRX;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.miband3;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -53,8 +52,7 @@ public class MiBand3Coordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && (name.equalsIgnoreCase(HuamiConst.MI_BAND3_NAME) || name.equalsIgnoreCase(HuamiConst.MI_BAND3_NAME_2))) {
|
||||
return DeviceType.MIBAND3;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.miband4;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -53,8 +52,7 @@ public class MiBand4Coordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase(HuamiConst.MI_BAND4_NAME)) {
|
||||
return DeviceType.MIBAND4;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.miband5;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -52,8 +51,7 @@ public class MiBand5Coordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase(HuamiConst.MI_BAND5_NAME)) {
|
||||
return DeviceType.MIBAND5;
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.miband6;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -30,8 +29,7 @@ public class MiBand6Coordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase(HuamiConst.MI_BAND6_NAME)) {
|
||||
return DeviceType.MIBAND6;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.miband7;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -41,8 +40,7 @@ public class MiBand7Coordinator extends Huami2021Coordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
if (name != null && name.startsWith(HuamiConst.XIAOMI_SMART_BAND7_NAME)) {
|
||||
return DeviceType.MIBAND7;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppe;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -47,8 +46,7 @@ public class ZeppECoordinator extends HuamiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("Zepp E")) {
|
||||
return DeviceType.ZEPP_E;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class ITagCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@Override
|
||||
@NonNull
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.toLowerCase().startsWith("itag")) { // All four: iTAG, iTag, ITAG and ITag exist
|
||||
return DeviceType.ITAG;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public class BFH16DeviceCoordinator extends AbstractBLEDeviceCoordinator
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null) {
|
||||
if (name.startsWith("BFH-16")) {
|
||||
return DeviceType.BFH16;
|
||||
|
@ -70,7 +70,7 @@ public class TeclastH30Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return DeviceType.TECLASTH30;
|
||||
}
|
||||
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null) {
|
||||
if (name.startsWith("TECLAST_H30") || name.startsWith("TECLAST_H10")) {
|
||||
return DeviceType.TECLASTH30;
|
||||
|
@ -51,7 +51,7 @@ public class Y5Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null) {
|
||||
if (name.contains("Y5")) {
|
||||
return DeviceType.Y5;
|
||||
|
@ -39,7 +39,7 @@ public class LiveviewCoordinator extends AbstractBLClassicDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.startsWith("LiveView")) {
|
||||
return DeviceType.LIVEVIEW;
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ public class MakibesHR3Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
|
||||
List<String> deviceNames = new ArrayList<String>(){{
|
||||
add("Y808"); // Chinese version
|
||||
|
@ -88,7 +88,7 @@ public class MiBandCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
if (isHealthWearable(device)) {
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.toUpperCase().startsWith(MiBandConst.MI_GENERAL_NAME_PREFIX.toUpperCase())) {
|
||||
return DeviceType.MIBAND;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public class MijiaLywsd02Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equals("LYWSD02")) {
|
||||
return DeviceType.MIJIA_LYWSD02;
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.miscale2;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.bluetooth.le.ScanFilter;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
@ -60,8 +59,7 @@ public class MiScale2DeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.equalsIgnoreCase("MIBCS")) {
|
||||
return DeviceType.MISCALE2;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public class No1F1Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && (name.startsWith("X-RUN") || name.startsWith("MH30"))) {
|
||||
return DeviceType.NO1F1;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class NutCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@Override
|
||||
@NonNull
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.toLowerCase().startsWith("nut")) {
|
||||
return DeviceType.NUTMINI;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public class PebbleCoordinator extends AbstractBLClassicDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.startsWith("Pebble")) {
|
||||
return DeviceType.PEBBLE;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class PineTimeJFCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && (name.startsWith("Pinetime-JF") || name.startsWith("InfiniTime"))) {
|
||||
return DeviceType.PINETIME_JF;
|
||||
}
|
||||
|
@ -17,8 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.roidmi;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -35,8 +33,7 @@ public class Roidmi1Coordinator extends RoidmiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
|
||||
if (name != null && name.contains("睿米车载蓝牙播放器")) {
|
||||
return DeviceType.ROIDMI;
|
||||
|
@ -17,8 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.roidmi;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -35,8 +33,7 @@ public class Roidmi3Coordinator extends RoidmiCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
||||
try {
|
||||
final BluetoothDevice device = candidate.getDevice();
|
||||
final String name = device.getName();
|
||||
final String name = candidate.getName();
|
||||
|
||||
if (name == null) {
|
||||
return DeviceType.UNKNOWN;
|
||||
|
@ -1,7 +1,6 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.smaq2oss;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.bluetooth.le.ScanFilter;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
@ -47,8 +46,7 @@ public class SMAQ2OSSCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
// TODO still match for "SMA-Q2-OSS" because of backward firmware compatibility - remove eventually
|
||||
if (name != null && (name.startsWith("SMAQ2-") || name.equalsIgnoreCase("SMA-Q2-OSS"))) {
|
||||
return DeviceType.SMAQ2OSS;
|
||||
|
@ -39,7 +39,7 @@ public class SoFlowCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.startsWith("SoFlow-")) {
|
||||
return DeviceType.SOFLOW_SO6;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public class SonySWR12DeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && !name.isEmpty() && name.toLowerCase().contains("swr12"))
|
||||
return getDeviceType();
|
||||
} catch (Exception exc){}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.supercars;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
@ -36,8 +35,7 @@ public class SuperCarsCoordinator extends AbstractDeviceCoordinator {
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
try {
|
||||
BluetoothDevice device = candidate.getDevice();
|
||||
String name = device.getName();
|
||||
String name = candidate.getName();
|
||||
|
||||
if (name != null && name.startsWith("QCAR-")) {
|
||||
return DeviceType.SUPER_CARS;
|
||||
|
@ -48,7 +48,7 @@ public class TLW64Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.startsWith("Smart Bee")) {
|
||||
return DeviceType.TLW64;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class VibratissimoCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.startsWith("Vibratissimo")) {
|
||||
return DeviceType.VIBRATISSIMO;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public class WaspOSCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
/* Filter by Espruino devices to avoid getting
|
||||
the device chooser full of spam devices. */
|
||||
if (name != null && (
|
||||
|
@ -53,7 +53,7 @@ public class WithingsSteelHRDeviceCoordinator extends AbstractDeviceCoordinator
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && (name.toLowerCase(Locale.ROOT).startsWith("steel") || name.toLowerCase(Locale.ROOT).startsWith("activite"))) {
|
||||
return DeviceType.WITHINGS_STEEL_HR;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class XWatchCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.startsWith("XWatch")) {
|
||||
return DeviceType.XWATCH;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class ZeTimeCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
String name = candidate.getName();
|
||||
if (name != null && name.startsWith("ZeTime")) {
|
||||
return DeviceType.ZETIME;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user