1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-20 12:00:51 +02:00

Zepp OS: Recognize devices with a dash before mac address suffix

This commit is contained in:
José Rebelo 2024-02-02 20:58:00 +00:00
parent 944e0d92a7
commit 145c2b8c6c

View File

@ -88,9 +88,10 @@ public abstract class ZeppOsCoordinator extends HuamiCoordinator {
protected final Pattern getSupportedDeviceName() {
// Most devices use the exact bluetooth name
// Some devices have a " XXXX" suffix with the last 4 digits of mac address (eg. Mi Band 7)
// *However*, some devices broadcast a 2nd bluetooth device with "-XXXX" suffix, which is only
// used for calls and Gadgetbridge can't use for pairing.
return Pattern.compile("^" + getDeviceBluetoothName() + "( [A-Z0-9]{4})?$");
// *However*, some devices broadcast a 2nd bluetooth device with "-XXXX" suffix, which I believe
// is only used for calls, and Gadgetbridge can't use for pairing, but I was not yet able to
// fully confirm this, so we still recognize them.
return Pattern.compile("^" + getDeviceBluetoothName() + "([- ][A-Z0-9]{4})?$");
}
@NonNull