From 912c0f129903c31fca0f6caac622bf3f952463ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Wed, 6 Aug 2025 21:36:15 +0100 Subject: [PATCH] Blackview R60: Initial support --- .../moyoung/BlackviewR60Coordinator.java | 77 +++++++++++++++++++ .../gadgetbridge/model/DeviceType.java | 2 + app/src/main/res/values/strings.xml | 1 + 3 files changed, 80 insertions(+) create mode 100644 app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/moyoung/BlackviewR60Coordinator.java diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/moyoung/BlackviewR60Coordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/moyoung/BlackviewR60Coordinator.java new file mode 100644 index 0000000000..a633db2bec --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/moyoung/BlackviewR60Coordinator.java @@ -0,0 +1,77 @@ +/* Copyright (C) 2025 Arjan Schrijver + + 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.moyoung; + +import androidx.annotation.DrawableRes; + +import java.util.regex.Pattern; + +import nodomain.freeyourgadget.gadgetbridge.R; +import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; + +public class BlackviewR60Coordinator extends AbstractMoyoungDeviceCoordinator { + @Override + protected Pattern getSupportedDeviceName() { + return Pattern.compile("^R60$"); + } + + @Override + public int getDeviceNameResource() { + return R.string.devicetype_blackview_r60; + } + + @Override + @DrawableRes + public int getDefaultIconResource() { + return R.drawable.ic_device_amazfit_bip; + } + + @Override + public String getManufacturer() { + return "Blackview"; + } + + @Override + public int getMtu() { + return 508; + } + + @Override + public int getAlarmSlotCount(final GBDevice device) { + return 8; + } + + @Override + public int getWorldClocksSlotCount() { + return 6; + } + + @Override + public int getWorldClocksLabelLength() { + return 30; + } + + @Override + public boolean supportsRemSleep() { + return true; + } + + @Override + public boolean supportsStressMeasurement() { + return true; + } +} \ No newline at end of file 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 44cf18abec..090ddbb4f2 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -277,6 +277,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.miscale.MiCompositionScaleCo import nodomain.freeyourgadget.gadgetbridge.devices.miscale.MiSmartScaleCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.moondrop.MoondropSpaceTravelCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.moyoung.AdvanWatchSE1AICoordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.moyoung.BlackviewR60Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.moyoung.C20Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.moyoung.ColmiI28UltraCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.moyoung.ColmiP76Coordinator; @@ -749,6 +750,7 @@ public enum DeviceType { COLMI_P76(ColmiP76Coordinator.class), COLMI_V72(ColmiV72Coordinator.class), COLMI_V89(ColmiV89Coordinator.class), + BLACKVIEW_R60(BlackviewR60Coordinator.class), MISIRUN_C17(MisirunC17Coordinator.class), C20(C20Coordinator.class), KT80(KT80Coordinator.class), diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ba96dffb44..c64d66ab3b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2089,6 +2089,7 @@ Colmi P76 Colmi V72 Colmi V89 + Blackview R60 Misirun C17 C20 KT80