mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Add Huawei FreeArc support
Basically they use same protocol as previous FreeBuds series, and only lack features like ANC or LDAC. Battery (earphones and case) and device version info work fine.
This commit is contained in:
+64
@@ -0,0 +1,64 @@
|
||||
/* Copyright (C) 2025
|
||||
|
||||
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.huawei.freearc;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiFreebudsCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiHeadphonesCapabilities;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.huawei.HuaweiFreebudsSupport;
|
||||
|
||||
public class HuaweiFreearcCoordinator extends HuaweiFreebudsCoordinator {
|
||||
|
||||
@Override
|
||||
protected Pattern getSupportedDeviceName() {
|
||||
return Pattern.compile("huawei freearc", Pattern.CASE_INSENSITIVE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<HuaweiHeadphonesCapabilities> getCapabilities() {
|
||||
return new HashSet<>(
|
||||
// None
|
||||
);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Class<? extends DeviceSupport> getDeviceSupportClass(final GBDevice device) {
|
||||
return HuaweiFreebudsSupport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceType getDeviceType() {
|
||||
return DeviceType.HUAWEI_FREEARC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_huawei_freearc;
|
||||
}
|
||||
}
|
||||
@@ -223,6 +223,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.Amazfit
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitTRex3Coordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitTRexUltraCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.MiBand7Coordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.freearc.HuaweiFreearcCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.freebuds5i.HuaweiFreebuds5iCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.freebuds6.HuaweiFreebuds6Coordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.freebudspro.HuaweiFreebudsProCoordinator;
|
||||
@@ -733,6 +734,7 @@ public enum DeviceType {
|
||||
HUAWEIWATCH3(HuaweiWatch3Coordinator.class),
|
||||
HUAWEIWATCH4PRO(HuaweiWatch4ProCoordinator.class),
|
||||
HUAWEIWATCH5(HuaweiWatch5Coordinator.class),
|
||||
HUAWEI_FREEARC(HuaweiFreearcCoordinator.class),
|
||||
HUAWEI_FREEBUDS5I(HuaweiFreebuds5iCoordinator.class),
|
||||
HUAWEI_FREEBUDS_PRO(HuaweiFreebudsProCoordinator.class),
|
||||
HUAWEI_FREEBUDS6(HuaweiFreebuds6Coordinator.class),
|
||||
|
||||
@@ -2060,6 +2060,7 @@
|
||||
<string name="devicetype_huawei_watch3" translatable="false">Huawei Watch 3 (Pro)</string>
|
||||
<string name="devicetype_huawei_watch4pro" translatable="false">Huawei Watch 4 (Pro)</string>
|
||||
<string name="devicetype_huawei_watch5" translatable="false">Huawei Watch 5</string>
|
||||
<string name="devicetype_huawei_freearc" translatable="false">Huawei FreeArc</string>
|
||||
<string name="devicetype_huawei_freebuds_5i" translatable="false">Huawei FreeBuds 5i</string>
|
||||
<string name="devicetype_huawei_freebuds_pro" translatable="false">Huawei FreeBuds Pro</string>
|
||||
<string name="devicetype_huawei_freebuds_6" translatable="false">Huawei FreeBuds 6</string>
|
||||
|
||||
Reference in New Issue
Block a user