diff --git a/CHANGELOG.md b/CHANGELOG.md index f2d5ca440..818df2a0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ #### Next Version (WIP) * Initial support for Mijia MHO-C303 +* Initial support for Sony WI-SP600N * Experimental support for Xiaomi Smart Band 8 Pro * Experimental support for Xiaomi Watch S1 Pro * Experimental support for Xiaomi Watch S1 diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWISP600NCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWISP600NCoordinator.java new file mode 100644 index 000000000..c1c4800b4 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWISP600NCoordinator.java @@ -0,0 +1,56 @@ +/* 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 . */ +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 SonyWISP600NCoordinator extends SonyHeadphonesCoordinator { + @Override + protected Pattern getSupportedDeviceName() { + return Pattern.compile(".*WI-SP600N.*"); + } + @Override + public int getDeviceNameResource() { + return R.string.devicetype_sony_wi_sp600n; + } + + @Override + public List getCapabilities() { + return Arrays.asList( + SonyHeadphonesCapabilities.BatterySingle, + SonyHeadphonesCapabilities.AmbientSoundControl, + SonyHeadphonesCapabilities.WindNoiseReduction, + SonyHeadphonesCapabilities.EqualizerWithCustomBands, + SonyHeadphonesCapabilities.SoundPosition, + SonyHeadphonesCapabilities.SurroundMode, + SonyHeadphonesCapabilities.PowerOffFromPhone, + SonyHeadphonesCapabilities.AutomaticPowerOffByTime, + SonyHeadphonesCapabilities.VoiceNotifications, + SonyHeadphonesCapabilities.Volume + ); + } +} diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java index 6f930ad59..c2f5be716 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -152,6 +152,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.SonyWISP600NCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM2Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM3Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM4Coordinator; @@ -319,6 +320,7 @@ public enum DeviceType { GALAXY_BUDS2_PRO(GalaxyBuds2ProDeviceCoordinator.class), SONY_WH_1000XM3(SonyWH1000XM3Coordinator.class), SONY_WF_SP800N(SonyWFSP800NCoordinator.class), + SONY_WI_SP600N(SonyWISP600NCoordinator.class), SONY_WH_1000XM4(SonyWH1000XM4Coordinator.class), SONY_WF_1000XM3(SonyWF1000XM3Coordinator.class), SONY_WH_1000XM2(SonyWH1000XM2Coordinator.class), diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/SonyHeadphonesProtocol.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/SonyHeadphonesProtocol.java index de70a2e21..4804d44e5 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/SonyHeadphonesProtocol.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/SonyHeadphonesProtocol.java @@ -120,6 +120,7 @@ public class SonyHeadphonesProtocol extends GBDeviceProtocol { if (message.getPayload().length == 4) { // WH-1000XM3: 01:00:40:10 // WF-SP800N 1.0.1: 01:00:70:00 + // Wi-SP600N: 01:00:40:10 protocolVersion = "v1"; } else if (message.getPayload().length == 8) { switch (message.getPayload()[2]) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e3a355941..078a7ed5a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1432,6 +1432,7 @@ Sony WF-1000XM3 Sony WF-1000XM4 Sony WF-1000XM5 + Sony WI-SP600N Sony LinkBuds S Binary sensor Honor Band 3