mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Mi Band 4C: Experimental support
This commit is contained in:
+53
@@ -0,0 +1,53 @@
|
||||
/* Copyright (C) 2026 José Rebelo
|
||||
|
||||
This file is part of Gadgetbridge.
|
||||
|
||||
Gadgetbridge is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Gadgetbridge is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
|
||||
public class MiBand4CCoordinator extends XiaomiCoordinator {
|
||||
@Override
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_miband4c;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Pattern getSupportedDeviceName() {
|
||||
return Pattern.compile("^Mi Smart Band 4C_[0-9A-F]{4}$");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_default;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExperimental() {
|
||||
// #2020 - Untested
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceKind getDeviceKind(@NonNull GBDevice device) {
|
||||
return DeviceKind.FITNESS_BAND;
|
||||
}
|
||||
}
|
||||
@@ -405,6 +405,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.waspos.WaspOSCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.watch9.Watch9DeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.withingssteelhr.WithingsSteelHRDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiBand10Coordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiBand4CCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiBand7ProCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiBand8ActiveCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiBand8Coordinator;
|
||||
@@ -470,6 +471,7 @@ public enum DeviceType {
|
||||
MIBAND3(MiBand3Coordinator.class),
|
||||
AMAZFITCOR2(AmazfitCor2Coordinator.class),
|
||||
MIBAND4(MiBand4Coordinator.class),
|
||||
MIBAND4C(MiBand4CCoordinator.class),
|
||||
AMAZFITBIP_LITE(AmazfitBipLiteCoordinator.class),
|
||||
AMAZFITGTR(AmazfitGTRCoordinator.class),
|
||||
AMAZFITGTS(AmazfitGTSCoordinator.class),
|
||||
|
||||
@@ -1841,6 +1841,7 @@
|
||||
<string name="devicetype_miband2" translatable="false">Mi Band 2</string>
|
||||
<string name="devicetype_miband3" translatable="false">Mi Band 3</string>
|
||||
<string name="devicetype_miband4" translatable="false">Mi Band 4</string>
|
||||
<string name="devicetype_miband4c" translatable="false">Mi Band 4C</string>
|
||||
<string name="devicetype_miband5" translatable="false">Mi Band 5</string>
|
||||
<string name="devicetype_miband6" translatable="false">Mi Band 6</string>
|
||||
<string name="devicetype_miband7" translatable="false">Xiaomi Smart Band 7</string>
|
||||
|
||||
+1
@@ -26,6 +26,7 @@ public class AbstractDeviceCoordinatorTest extends TestBase {
|
||||
put("Amazfit T-Rex 2", DeviceType.AMAZFITTREX2); // #3033
|
||||
put("T-Rex 3 Pro (48mm)-6752", DeviceType.AMAZFITTREX3PRO48MM); // #5533
|
||||
put("Amazfit GTS 4 mini New", DeviceType.AMAZFITGTS4MININEW); // #5472
|
||||
put("Mi Smart Band 4C_D77E", DeviceType.MIBAND4C);
|
||||
put("Xiaomi Band 9 Active AB01", DeviceType.MIBAND9ACTIVE);
|
||||
put("vívoactive 6", DeviceType.GARMIN_VIVOACTIVE_6);
|
||||
put("CMF Buds 2", DeviceType.NOTHING_CMF_BUDS_2); // #5579
|
||||
|
||||
Reference in New Issue
Block a user