1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-22 14:52:25 +02:00

Sony LinkBuds S: Initial support

This commit is contained in:
José Rebelo 2022-12-07 20:14:33 +00:00
parent 07194cd8fb
commit f2aaf5aecf
5 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,58 @@
/* Copyright (C) 2022 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.sony.headphones.coordinators;
import androidx.annotation.NonNull;
import java.util.Arrays;
import java.util.List;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCapabilities;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
public class SonyLinkBudsSCoordinator extends SonyHeadphonesCoordinator {
@NonNull
@Override
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
if (candidate.getName().contains("LinkBuds S")) {
return DeviceType.SONY_LINKBUDS_S;
}
return DeviceType.UNKNOWN;
}
@Override
public DeviceType getDeviceType() {
return DeviceType.SONY_LINKBUDS_S;
}
@Override
public List<SonyHeadphonesCapabilities> getCapabilities() {
return Arrays.asList(
SonyHeadphonesCapabilities.BatteryDual,
SonyHeadphonesCapabilities.BatteryCase,
SonyHeadphonesCapabilities.AmbientSoundControl,
SonyHeadphonesCapabilities.EqualizerSimple,
SonyHeadphonesCapabilities.AudioUpsampling,
SonyHeadphonesCapabilities.ButtonModesLeftRight,
SonyHeadphonesCapabilities.PauseWhenTakenOff,
SonyHeadphonesCapabilities.AutomaticPowerOffWhenTakenOff
);
}
}

View File

@ -120,6 +120,7 @@ public enum DeviceType {
SONY_WF_1000XM3(433, R.drawable.ic_device_galaxy_buds, R.drawable.ic_device_galaxy_buds_disabled, R.string.devicetype_sony_wf_1000xm3),
SONY_WH_1000XM2(434, R.drawable.ic_device_sony_overhead, R.drawable.ic_device_sony_overhead_disabled, R.string.devicetype_sony_wh_1000xm2),
SONY_WF_1000XM4(435, R.drawable.ic_device_galaxy_buds, R.drawable.ic_device_galaxy_buds_disabled, R.string.devicetype_sony_wf_1000xm4),
SONY_LINKBUDS_S(436, R.drawable.ic_device_galaxy_buds, R.drawable.ic_device_galaxy_buds_disabled, R.string.devicetype_sony_linkbuds_s),
BOSE_QC35(440, R.drawable.ic_device_headphones, R.drawable.ic_device_headphones_disabled, R.string.devicetype_bose_qc35),
VESC_NRF(500, R.drawable.ic_device_vesc, R.drawable.ic_device_vesc_disabled, R.string.devicetype_vesc),
VESC_HM10(501, R.drawable.ic_device_vesc, R.drawable.ic_device_vesc_disabled, R.string.devicetype_vesc),

View File

@ -342,6 +342,8 @@ public class DeviceSupportFactory {
return new ServiceDeviceSupport(new SonyHeadphonesSupport());
case SONY_WF_1000XM4:
return new ServiceDeviceSupport(new SonyHeadphonesSupport());
case SONY_LINKBUDS_S:
return new ServiceDeviceSupport(new SonyHeadphonesSupport());
case VESC_NRF:
case VESC_HM10:
return new ServiceDeviceSupport(new VescDeviceSupport(device.getType()));

View File

@ -45,6 +45,7 @@ import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts4.AmazfitGTS4Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts4mini.AmazfitGTS4MiniCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyLinkBudsSCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.supercars.SuperCarsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.fitpro.FitProDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.UnknownDeviceCoordinator;
@ -345,6 +346,7 @@ public class DeviceHelper {
result.add(new GalaxyBudsProDeviceCoordinator());
result.add(new GalaxyBuds2DeviceCoordinator());
result.add(new VescCoordinator());
result.add(new SonyLinkBudsSCoordinator());
result.add(new SonyWH1000XM3Coordinator());
result.add(new SonyWH1000XM4Coordinator());
result.add(new SonyWFSP800NCoordinator());

View File

@ -1229,6 +1229,7 @@
<string name="devicetype_sony_wf_sp800n">Sony WF-SP800N</string>
<string name="devicetype_sony_wf_1000xm3">Sony WF-1000XM3</string>
<string name="devicetype_sony_wf_1000xm4">Sony WF-1000XM4</string>
<string name="devicetype_sony_linkbuds_s">Sony LinkBuds S</string>
<string name="devicetype_binary_sensor">Binary sensor</string>
<string name="choose_auto_export_location">Choose export location</string>
<string name="notification_channel_name">General</string>