1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-11 20:49:25 +01:00

Mi Band 8: Display items (wip)

This commit is contained in:
José Rebelo 2023-10-06 13:26:57 +01:00
parent e8695a5792
commit eb2a2ca742

View File

@ -49,6 +49,7 @@ public class XiaomiSystemService extends AbstractXiaomiService {
public static final int CMD_PASSWORD_GET = 9; public static final int CMD_PASSWORD_GET = 9;
public static final int CMD_FIND_PHONE = 17; public static final int CMD_FIND_PHONE = 17;
public static final int CMD_PASSWORD_SET = 21; public static final int CMD_PASSWORD_SET = 21;
public static final int CMD_DISPLAY_ITEMS_GET = 29;
public static final int CMD_CHARGER = 79; public static final int CMD_CHARGER = 79;
public XiaomiSystemService(final XiaomiSupport support) { public XiaomiSystemService(final XiaomiSupport support) {
@ -61,6 +62,7 @@ public class XiaomiSystemService extends AbstractXiaomiService {
getSupport().sendCommand(builder, COMMAND_TYPE, CMD_DEVICE_INFO); getSupport().sendCommand(builder, COMMAND_TYPE, CMD_DEVICE_INFO);
getSupport().sendCommand(builder, COMMAND_TYPE, CMD_BATTERY); getSupport().sendCommand(builder, COMMAND_TYPE, CMD_BATTERY);
getSupport().sendCommand(builder, COMMAND_TYPE, CMD_PASSWORD_GET); getSupport().sendCommand(builder, COMMAND_TYPE, CMD_PASSWORD_GET);
getSupport().sendCommand(builder, COMMAND_TYPE, CMD_DISPLAY_ITEMS_GET);
} }
@Override @Override
@ -86,6 +88,9 @@ public class XiaomiSystemService extends AbstractXiaomiService {
} }
getSupport().evaluateGBDeviceEvent(findPhoneEvent); getSupport().evaluateGBDeviceEvent(findPhoneEvent);
return; return;
case CMD_DISPLAY_ITEMS_GET:
handleDisplayItems(cmd.getSystem().getDisplayItems());
return;
case CMD_CHARGER: case CMD_CHARGER:
// charger event, request battery state // charger event, request battery state
getSupport().sendCommand("request battery state", COMMAND_TYPE, CMD_BATTERY); getSupport().sendCommand("request battery state", COMMAND_TYPE, CMD_BATTERY);
@ -228,6 +233,10 @@ public class XiaomiSystemService extends AbstractXiaomiService {
getSupport().evaluateGBDeviceEvent(eventUpdatePreferences); getSupport().evaluateGBDeviceEvent(eventUpdatePreferences);
} }
private void handleDisplayItems(final XiaomiProto.DisplayItems displayItems) {
LOG.debug("Got {} display items", displayItems.getDisplayItemCount());
}
public void onFindPhone(final boolean start) { public void onFindPhone(final boolean start) {
LOG.debug("Find phone: {}", start); LOG.debug("Find phone: {}", start);