CMF Watch Pro 3: Initial support

This commit is contained in:
José Rebelo
2025-12-25 14:24:45 +00:00
parent c453e3a346
commit a1d101f559
4 changed files with 62 additions and 2 deletions
@@ -0,0 +1,56 @@
/* 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.cmfwatchpro;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
public class CmfWatchPro3Coordinator extends CmfWatchProCoordinator {
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("^CMF Watch 3 Pro(-[A-Z0-9]{4})$");
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_nothing_cmf_watch_pro_3;
}
@Override
public int getDefaultIconResource() {
return R.drawable.ic_device_watchxplus;
}
@Override
public int getBondingStyle() {
// We can negotiate auth key - #3982
return BONDING_STYLE_BOND;
}
@Override
public boolean supportsSunriseSunset() {
return true;
}
@Override
public int getContactsSlotCount(final GBDevice device) {
// FIXME: #5596 - Not working properly
return 0;
}
}
@@ -41,6 +41,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.casio.gbx100.CasioGBX100Devi
import nodomain.freeyourgadget.gadgetbridge.devices.casio.gwb5600.CasioGMWB5000DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.casio.gwb5600.CasioGWB5600DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.cmfwatchpro.CmfWatchPro2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.cmfwatchpro.CmfWatchPro3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.cmfwatchpro.CmfWatchProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.coospo.CoospoH6Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.coospo.CoospoH9ZCoordinator;
@@ -707,6 +708,7 @@ public enum DeviceType {
NOTHING_CMF_BUDS_PRO_2(CmfBudsPro2Coordinator.class),
NOTHING_CMF_WATCH_PRO(CmfWatchProCoordinator.class),
NOTHING_CMF_WATCH_PRO_2(CmfWatchPro2Coordinator.class),
NOTHING_CMF_WATCH_PRO_3(CmfWatchPro3Coordinator.class),
GALAXY_BUDS_PRO(GalaxyBudsProDeviceCoordinator.class),
GALAXY_BUDS_LIVE(GalaxyBudsLiveDeviceCoordinator.class),
GALAXY_BUDS(GalaxyBudsDeviceCoordinator.class),
+1
View File
@@ -3002,6 +3002,7 @@
<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>
<string name="devicetype_nothing_cmf_watch_pro_3" translatable="false">CMF Watch Pro 3</string>
<string name="devicetype_oppo_enco_air" translatable="false">Oppo Enco Air</string>
<string name="devicetype_oppo_enco_air2" translatable="false">Oppo Enco Air2</string>
<string name="devicetype_oppo_enco_buds2" translatable="false">Oppo Enco Buds2</string>
@@ -35,7 +35,7 @@ public class AbstractDeviceCoordinatorTest extends TestBase {
put("P80", DeviceType.COLMI_P80);
put("BT103(ID-AB01)", DeviceType.OUKITEL_BT103);
put("P66D(ID-AB01)", DeviceType.DOTN_P66D);
put("R1(ID-10B5)", DeviceType.R1);
put("R1(ID-10B5)", DeviceType.R1); // #5621
put("IMIKI FRAME 2", DeviceType.IMIKI_FRAME_2);
put("HAYLOU Watch 2 Pro", DeviceType.HAYLOU_WATCH_2_PRO);
put("Y66(ID-AB01)", DeviceType.Y66);
@@ -99,6 +99,7 @@ public class AbstractDeviceCoordinatorTest extends TestBase {
put("IMP-2027", DeviceType.VIVITAR_HR_BP_MONITOR_ACTIVITY_TRACKER); // #3925
put("CMF Buds Pro 2", DeviceType.NOTHING_CMF_BUDS_PRO_2); // #3924
put("CMF Watch Pro 2-0DCA", DeviceType.NOTHING_CMF_WATCH_PRO_2); // #3899
put("CMF Watch 3 Pro-D286", DeviceType.NOTHING_CMF_WATCH_PRO_3); // #5596
put("vívomove Trend", DeviceType.GARMIN_VIVOMOVE_TREND); // #3875
put("fenix 5", DeviceType.GARMIN_FENIX_5); // #3869
put("Forerunner 255S", DeviceType.GARMIN_FORERUNNER_255S); // #3841
@@ -159,7 +160,7 @@ public class AbstractDeviceCoordinatorTest extends TestBase {
put("M4-4711", DeviceType.FITPRO);
put("C20", DeviceType.C20); // #4070
put("C 20", DeviceType.C20); // #5495
put("OV-Touch2.6_LE", DeviceType.OVTOUCH26);
put("OV-Touch2.6_LE", DeviceType.OVTOUCH26); // #5628
}};
for (Map.Entry<String, DeviceType> e : bluetoothNameToExpectedType.entrySet()) {