1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-02 11:26:09 +02:00

Initial support for Sony WH-XB910N

This commit is contained in:
Treeager 2024-04-27 19:14:04 +03:00
parent aad03ddf0e
commit d3dd7a4b98
4 changed files with 62 additions and 0 deletions

View File

@ -2,6 +2,7 @@
#### Next release (WIP)
* Initial support for Sony WH-XB910N
* AsteroidOS: Added icons to the notifications
* Bangle.js: Add screenshot support
* Bangle.js: Add setting to disable notifications

View File

@ -0,0 +1,58 @@
/* Copyright (C) 2021-2024 Daniel Dakhno, José Rebelo, Petr Vaněk
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.List;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
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 SonyWHXB910NCoordinator extends SonyHeadphonesCoordinator {
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("WH-XB910N*");
}
public int getDeviceNameResource() {
return R.string.devicetype_sony_wh_xb910n;
}
@Override
public List<SonyHeadphonesCapabilities> getCapabilities() {
return Arrays.asList(
SonyHeadphonesCapabilities.AmbientSoundControl, // Ambient Sound Level doesn't work, it sets the Ambient sound level to 150 in the Sony app.
SonyHeadphonesCapabilities.BatterySingle,
SonyHeadphonesCapabilities.VoiceNotifications,
SonyHeadphonesCapabilities.EqualizerWithCustomBands,
SonyHeadphonesCapabilities.PowerOffFromPhone,
SonyHeadphonesCapabilities.AutomaticPowerOffByTime
// SonyHeadphonesCapabilities.AudioUpsampling, // idk if it works
// SonyHeadphonesCapabilities.AmbientSoundControlButtonMode, // Doesn't work
// SonyHeadphonesCapabilities.WindNoiseReduction, // Changing mode doesn't work when this is enabled
// SonyHeadphonesCapabilities.Volume, // Doesn't work
);
}
}

View File

@ -160,6 +160,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWF1000XM4Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWF1000XM5Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWFSP800NCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWHXB910NCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWISP600NCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM3Coordinator;
@ -339,6 +340,7 @@ public enum DeviceType {
SONY_WH_1000XM3(SonyWH1000XM3Coordinator.class),
SONY_WF_SP800N(SonyWFSP800NCoordinator.class),
SONY_WI_SP600N(SonyWISP600NCoordinator.class),
SONY_WH_XB910N(SonyWHXB910NCoordinator.class),
SONY_WH_1000XM4(SonyWH1000XM4Coordinator.class),
SONY_WF_1000XM3(SonyWF1000XM3Coordinator.class),
SONY_WH_1000XM2(SonyWH1000XM2Coordinator.class),

View File

@ -1526,6 +1526,7 @@
<string name="devicetype_sony_wh_1000xm3">Sony WH-1000XM3</string>
<string name="devicetype_sony_wh_1000xm4">Sony WH-1000XM4</string>
<string name="devicetype_sony_wh_1000xm5">Sony WH-1000XM5</string>
<string name="devicetype_sony_wh_xb910n">Sony WH-XB910N</string>
<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>