1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-23 05:20:35 +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() { protected final Pattern getSupportedDeviceName() {
// Most devices use the exact bluetooth name // 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) // 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 // *However*, some devices broadcast a 2nd bluetooth device with "-XXXX" suffix, which I believe
// used for calls and Gadgetbridge can't use for pairing. // is only used for calls, and Gadgetbridge can't use for pairing, but I was not yet able to
return Pattern.compile("^" + getDeviceBluetoothName() + "( [A-Z0-9]{4})?$"); // fully confirm this, so we still recognize them.
return Pattern.compile("^" + getDeviceBluetoothName() + "([- ][A-Z0-9]{4})?$");
} }
@NonNull @NonNull