mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-25 16:15:55 +01:00
Mi Band 8: Update to use getSupportedDeviceName
This commit is contained in:
parent
08eb22b4cb
commit
241486f7c3
@ -19,7 +19,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@ -27,20 +26,11 @@ import java.util.regex.Pattern;
|
|||||||
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.xiaomi.XiaomiCoordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiCoordinator;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
|
||||||
|
|
||||||
public class MiBand8Coordinator extends XiaomiCoordinator {
|
public class MiBand8Coordinator extends XiaomiCoordinator {
|
||||||
private final Pattern NAME_PATTTERN = Pattern.compile("^Xiaomi Smart Band 8 [A-Z0-9]{4}$");
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
@Override
|
||||||
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
|
protected Pattern getSupportedDeviceName() {
|
||||||
if (NAME_PATTTERN.matcher(candidate.getName()).matches()) {
|
return Pattern.compile("^Xiaomi Smart Band 8 [A-Z0-9]{4}$");
|
||||||
return DeviceType.MIBAND8;
|
|
||||||
}
|
|
||||||
|
|
||||||
return DeviceType.UNKNOWN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
Loading…
Reference in New Issue
Block a user