diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/SonyHeadphonesCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/SonyHeadphonesCoordinator.java index ce55b01af..fd3fc20ba 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/SonyHeadphonesCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/SonyHeadphonesCoordinator.java @@ -97,16 +97,16 @@ public abstract class SonyHeadphonesCoordinator extends AbstractBLClassicDeviceC final List batteries = new ArrayList<>(3); if (supports(SonyHeadphonesCapabilities.BatterySingle)) { - batteries.add(new BatteryConfig(batteries.size())); + batteries.add(new BatteryConfig(batteries.size(), GBDevice.BATTERY_ICON_DEFAULT, GBDevice.BATTERY_LABEL_DEFAULT, getBatteryDefaultLowThreshold(), getBatteryDefaultFullThreshold())); } if (supports(SonyHeadphonesCapabilities.BatteryCase)) { - batteries.add(new BatteryConfig(batteries.size(), R.drawable.ic_tws_case, R.string.battery_case)); + batteries.add(new BatteryConfig(batteries.size(), R.drawable.ic_tws_case, R.string.battery_case, getBatteryDefaultLowThreshold(), getBatteryDefaultFullThreshold())); } if (supports(SonyHeadphonesCapabilities.BatteryDual) || supports(SonyHeadphonesCapabilities.BatteryDual2)) { - batteries.add(new BatteryConfig(batteries.size(), R.drawable.ic_galaxy_buds_l, R.string.left_earbud)); - batteries.add(new BatteryConfig(batteries.size(), R.drawable.ic_galaxy_buds_r, R.string.right_earbud)); + batteries.add(new BatteryConfig(batteries.size(), R.drawable.ic_galaxy_buds_l, R.string.left_earbud, getBatteryDefaultLowThreshold(), getBatteryDefaultFullThreshold())); + batteries.add(new BatteryConfig(batteries.size(), R.drawable.ic_galaxy_buds_r, R.string.right_earbud, getBatteryDefaultLowThreshold(), getBatteryDefaultFullThreshold())); } return batteries.toArray(new BatteryConfig[0]); @@ -216,6 +216,14 @@ public abstract class SonyHeadphonesCoordinator extends AbstractBLClassicDeviceC return false; } + public int getBatteryDefaultLowThreshold() { + return 20; + } + + public int getBatteryDefaultFullThreshold() { + return 100; + } + @NonNull @Override public Class getDeviceSupportClass() { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWFC700NCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWFC700NCoordinator.java index 1dc6917b6..492dba31e 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWFC700NCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWFC700NCoordinator.java @@ -28,7 +28,7 @@ public class SonyWFC700NCoordinator extends SonyHeadphonesCoordinator { @Override protected Pattern getSupportedDeviceName() { - return Pattern.compile(".*WF-C700N.*"); + return Pattern.compile("WF-C700N"); } @Override