Redmi Buds 6 Active: Initial support

This commit is contained in:
Me7c7 2024-12-31 19:49:45 +02:00
parent 1cd3004f0e
commit 9ca2cd4e8f
4 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,19 @@
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds5pro;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
public class RedmiBuds6ActiveCoordinator extends AbstractRedmiBudsCoordinator {
@Override
public int getDeviceNameResource() {
return R.string.devicetype_redmi_buds_6_active;
}
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("Redmi Buds 6 Active");
}
}

View File

@ -285,6 +285,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miwatch.MiWatchLiteCo
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miwatchcolorsport.MiWatchColorSportCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miwatchcolorsport.MiWatchColorSportCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds5pro.RedmiBuds4ActiveCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds5pro.RedmiBuds4ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds5pro.RedmiBuds5ProCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds5pro.RedmiBuds5ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds5pro.RedmiBuds6ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmismartband2.RedmiSmartBand2Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmismartband2.RedmiSmartBand2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmismartbandpro.RedmiSmartBandProCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmismartbandpro.RedmiSmartBandProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch2.RedmiWatch2Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch2.RedmiWatch2Coordinator;
@ -361,6 +362,7 @@ public enum DeviceType {
MIWATCHCOLORSPORT(MiWatchColorSportCoordinator.class), MIWATCHCOLORSPORT(MiWatchColorSportCoordinator.class),
REDMIBUDS4ACTIVE(RedmiBuds4ActiveCoordinator.class), REDMIBUDS4ACTIVE(RedmiBuds4ActiveCoordinator.class),
REDMIBUDS5PRO(RedmiBuds5ProCoordinator.class), REDMIBUDS5PRO(RedmiBuds5ProCoordinator.class),
REDMIBUDS6ACTIVE(RedmiBuds6ActiveCoordinator.class),
REDMIWATCH3ACTIVE(RedmiWatch3ActiveCoordinator.class), REDMIWATCH3ACTIVE(RedmiWatch3ActiveCoordinator.class),
REDMIWATCH3(RedmiWatch3Coordinator.class), REDMIWATCH3(RedmiWatch3Coordinator.class),
REDMISMARTBAND2(RedmiSmartBand2Coordinator.class), REDMISMARTBAND2(RedmiSmartBand2Coordinator.class),

View File

@ -231,6 +231,8 @@ public class RedmiBuds5ProProtocol extends GBDeviceProtocol {
} }
public void decodeGetConfig(byte[] configPayload) { public void decodeGetConfig(byte[] configPayload) {
if(configPayload.length < 3)
return;
SharedPreferences preferences = getDevicePrefs().getPreferences(); SharedPreferences preferences = getDevicePrefs().getPreferences();
Editor editor = preferences.edit(); Editor editor = preferences.edit();

View File

@ -1894,6 +1894,7 @@
<string name="devicetype_redmiwatch3">Redmi Watch 3</string> <string name="devicetype_redmiwatch3">Redmi Watch 3</string>
<string name="devicetype_redmi_buds_4_active">Redmi Buds 4 Active</string> <string name="devicetype_redmi_buds_4_active">Redmi Buds 4 Active</string>
<string name="devicetype_redmi_buds_5_pro">Redmi Buds 5 Pro</string> <string name="devicetype_redmi_buds_5_pro">Redmi Buds 5 Pro</string>
<string name="devicetype_redmi_buds_6_active">Redmi Buds 6 Active</string>
<string name="devicetype_redmi_smart_band_2">Redmi Smart Band 2</string> <string name="devicetype_redmi_smart_band_2">Redmi Smart Band 2</string>
<string name="devicetype_redmi_watch_2">Redmi Watch 2</string> <string name="devicetype_redmi_watch_2">Redmi Watch 2</string>
<string name="devicetype_redmi_watch_2_lite">Redmi Watch 2 Lite</string> <string name="devicetype_redmi_watch_2_lite">Redmi Watch 2 Lite</string>