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

Mi Band 8: Add find watch

This commit is contained in:
José Rebelo 2023-10-08 13:46:26 +01:00
parent 18fc29fae7
commit fcf680f799
2 changed files with 15 additions and 2 deletions

View File

@ -303,8 +303,7 @@ public class XiaomiSupport extends AbstractBTLEDeviceSupport {
@Override
public void onFindDevice(final boolean start) {
// TODO onFindDevice
super.onFindDevice(start);
systemService.onFindWatch(start);
}
@Override

View File

@ -55,6 +55,7 @@ public class XiaomiSystemService extends AbstractXiaomiService {
public static final int CMD_CLOCK = 3;
public static final int CMD_PASSWORD_GET = 9;
public static final int CMD_FIND_PHONE = 17;
public static final int CMD_FIND_WATCH = 18;
public static final int CMD_PASSWORD_SET = 21;
public static final int CMD_DISPLAY_ITEMS_GET = 29;
public static final int CMD_CHARGER = 79;
@ -301,4 +302,17 @@ public class XiaomiSystemService extends AbstractXiaomiService {
);
}
}
public void onFindWatch(final boolean start) {
LOG.debug("Find watch: {}", start);
getSupport().sendCommand(
"find watch " + start,
XiaomiProto.Command.newBuilder()
.setType(COMMAND_TYPE)
.setSubtype(CMD_FIND_WATCH)
.setSystem(XiaomiProto.System.newBuilder().setFindDevice(start ? 0 : 1).build())
.build()
);
}
}