1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-29 05:16:51 +01:00

Use GBDeviceCandidate#getName on all coordinators

This commit is contained in:
José Rebelo 2023-08-30 23:58:58 +01:00
parent 6f7fb261e7
commit a85246c279
85 changed files with 86 additions and 195 deletions

View File

@ -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 && (

View File

@ -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"))) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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){}

View File

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

View File

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

View File

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

View File

@ -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 && (

View File

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

View File

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

View File

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