Initial support for Sony WH-CH720N

This commit is contained in:
Nicolas Castillo
2025-10-19 17:41:24 +02:00
committed by Nícolas Castillo
parent b114fe1bd0
commit ec6113307f
3 changed files with 65 additions and 0 deletions
@@ -0,0 +1,62 @@
/* Copyright (C) 2025 Daniel Dakhno, 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.sony.headphones.coordinators;
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.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCapabilities;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
public class SonyWHCH720NCoordinator extends SonyHeadphonesCoordinator {
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile(".*WH-CH720N.*");
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_sony_wh_ch720n;
}
@Override
public Set<SonyHeadphonesCapabilities> getCapabilities() {
return new HashSet<>(Arrays.asList(
SonyHeadphonesCapabilities.BatterySingle,
SonyHeadphonesCapabilities.AmbientSoundControl,
// TODO SonyHeadphonesCapabilities.AmbientSoundControlButtonMode,
// TODO SonyHeadphonesCapabilities.AutomaticPowerOffByTime,
SonyHeadphonesCapabilities.EqualizerSimple,
SonyHeadphonesCapabilities.EqualizerWithCustomBands,
SonyHeadphonesCapabilities.PowerOffFromPhone,
SonyHeadphonesCapabilities.VoiceNotifications
// TODO SonyHeadphonesCapabilities.Volume
));
}
@Override
public DeviceCoordinator.DeviceKind getDeviceKind(@NonNull GBDevice device) {
return DeviceKind.HEADPHONES;
}
}
@@ -352,6 +352,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM4Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM5Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWHCH720NCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWHULT900NCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWIC100Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWISP600NCoordinator;
@@ -695,6 +696,7 @@ public enum DeviceType {
SONY_WF_C510(SonyWFC510Coordinator.class),
SONY_WF_C700N(SonyWFC700NCoordinator.class),
SONY_WF_C710N(SonyWFC710NCoordinator.class),
SONY_WH_CH720N(SonyWHCH720NCoordinator.class),
PIXEL_BUDS_A(PixelBudsACoordinator.class),
SHOKZ_OPENSWIM_PRO(ShokzOpenSwimProCoordinator.class),
SOUNDCORE_LIBERTY3_PRO(SoundcoreLiberty3ProCoordinator.class),
+1
View File
@@ -2028,6 +2028,7 @@
<string name="devicetype_sony_wh_1000xm4" translatable="false">Sony WH-1000XM4</string>
<string name="devicetype_sony_wh_1000xm5" translatable="false">Sony WH-1000XM5</string>
<string name="devicetype_sony_wh_ult900n" translatable="false">Sony WH-ULT900N</string>
<string name="devicetype_sony_wh_ch720n" translatable="false">Sony WH-CH720N</string>
<string name="devicetype_sony_wf_sp800n" translatable="false">Sony WF-SP800N</string>
<string name="devicetype_sony_wf_1000xm3" translatable="false">Sony WF-1000XM3</string>
<string name="devicetype_sony_wf_1000xm4" translatable="false">Sony WF-1000XM4</string>