1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-17 02:44:04 +02:00

makibes hr3 should now support the english version

This commit is contained in:
Cre3per 2019-10-16 15:37:29 +02:00 committed by Andreas Shimokawa
parent 2c718ecd01
commit 45184c4bbc
2 changed files with 12 additions and 4 deletions

View File

@ -216,7 +216,7 @@ public final class MakibesHR3Constants {
public static final byte ARG_SEND_NOTIFICATION_SOURCE_WEIBO = (byte) 0x13;
public static final byte ARG_SEND_NOTIFICATION_SOURCE_KAKOTALK = (byte) 0x14;
// ARG_SET_NOTIFICATION_SOURCE_*
// 02 (This is 00 and 01 during connection. I don't know what it does. Maybe clears notifications?)
// 02 (This is 00 and 01 during connection. Doesn't seem to do anything.)
// ASCII
public static final byte CMD_SEND_NOTIFICATION = (byte) 0x72;

View File

@ -18,7 +18,9 @@ package nodomain.freeyourgadget.gadgetbridge.devices.makibeshr3;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import android.app.Activity;
import android.content.Context;
@ -145,9 +147,15 @@ public class MakibesHR3Coordinator extends AbstractDeviceCoordinator {
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
String name = candidate.getDevice().getName();
// TODO: Device discovery
if ((name != null) && name.equals("Y808")) {
return DeviceType.MAKIBESHR3;
List<String> deviceNames = new ArrayList<String>(){{
add("Y808"); // Chinese version
add("MAKIBES HR3"); // English version
}};
if (name != null) {
if (deviceNames.contains(name)) {
return DeviceType.MAKIBESHR3;
}
}
return DeviceType.UNKNOWN;