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