CMF Buds 2: Initial support

This commit is contained in:
José Rebelo
2025-12-13 17:35:06 +00:00
parent f208e6a6fc
commit 74612b8db8
4 changed files with 47 additions and 0 deletions
@@ -0,0 +1,43 @@
/* Copyright (C) 2025 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 <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.nothing;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
public class CmfBuds2Coordinator extends AbstractEarCoordinator {
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("^CMF Buds 2$");
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_nothing_cmf_buds_2;
}
@Override
public boolean incrementCounter() {
return false;
}
@Override
public boolean supportsLightAncAndTransparency() {
return true;
}
}
@@ -320,6 +320,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.moyoung.R50ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.moyoung.RainbuvvyT97Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.moyoung.ViranC29Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.no1f1.No1F1Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.nothing.CmfBuds2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.nothing.CmfBudsPro2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.nothing.Ear1Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.nothing.Ear2Coordinator;
@@ -696,6 +697,7 @@ public enum DeviceType {
NOTHING_EAR2(Ear2Coordinator.class),
NOTHING_EAR_A(EarACoordinator.class),
NOTHING_EAR_STICK(EarStickCoordinator.class),
NOTHING_CMF_BUDS_2(CmfBuds2Coordinator.class),
NOTHING_CMF_BUDS_PRO_2(CmfBudsPro2Coordinator.class),
NOTHING_CMF_WATCH_PRO(CmfWatchProCoordinator.class),
NOTHING_CMF_WATCH_PRO_2(CmfWatchPro2Coordinator.class),
+1
View File
@@ -2993,6 +2993,7 @@
<string name="devicetype_nothingear2" translatable="false">Nothing Ear (2)</string>
<string name="devicetype_nothing_ear_a" translatable="false">Nothing Ear (a)</string>
<string name="devicetype_nothingearstick" translatable="false">Nothing Ear (Stick)</string>
<string name="devicetype_nothing_cmf_buds_2" translatable="false">CMF Buds 2</string>
<string name="devicetype_nothing_cmf_buds_pro_2" translatable="false">CMF Buds Pro 2</string>
<string name="devicetype_nothing_cmf_watch_pro" translatable="false">CMF Watch Pro</string>
<string name="devicetype_nothing_cmf_watch_pro_2" translatable="false">CMF Watch Pro 2</string>
@@ -28,6 +28,7 @@ public class AbstractDeviceCoordinatorTest extends TestBase {
put("Amazfit GTS 4 mini New", DeviceType.AMAZFITGTS4MININEW); // #5472
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
put("HC96", DeviceType.HC96);
put("P8", DeviceType.WASPOS); // from wasp-os source
put("P8DFU", DeviceType.WASPOS); // from wasp-os source