Redmi Watch 5: Initial support

This commit is contained in:
José Rebelo
2025-06-28 15:36:50 +01:00
parent 7889c7fd6e
commit c8e34040db
36 changed files with 123 additions and 63 deletions
@@ -14,7 +14,7 @@
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.xiaomi.redmibuds;
package nodomain.freeyourgadget.gadgetbridge.devices.redmibuds;
import androidx.annotation.NonNull;
@@ -1,4 +1,4 @@
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds;
package nodomain.freeyourgadget.gadgetbridge.devices.redmibuds;
import androidx.annotation.NonNull;
@@ -14,7 +14,7 @@
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.xiaomi.redmibuds;
package nodomain.freeyourgadget.gadgetbridge.devices.redmibuds;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.redmibuds;
package nodomain.freeyourgadget.gadgetbridge.devices.redmibuds;
import java.util.regex.Pattern;
@@ -1,4 +1,4 @@
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds;
package nodomain.freeyourgadget.gadgetbridge.devices.redmibuds;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.redmibuds;
package nodomain.freeyourgadget.gadgetbridge.devices.redmibuds;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.redmibuds;
package nodomain.freeyourgadget.gadgetbridge.devices.redmibuds;
import android.os.Parcel;
@@ -1,4 +1,4 @@
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds.prefs;
package nodomain.freeyourgadget.gadgetbridge.devices.redmibuds.prefs;
public class Configuration {
@@ -1,4 +1,4 @@
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds.prefs;
package nodomain.freeyourgadget.gadgetbridge.devices.redmibuds.prefs;
public class Gestures {
@@ -14,7 +14,7 @@
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.xiaomi.miband7pro;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.miband8active;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.miband8;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.miband8pro;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.miband9active;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.miband9;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.miband9pro;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.miwatchcolorsport;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.miwatch;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.redmismartband2;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.redmismartbandpro;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.redmiwatch2;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.redmiwatch2lite;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.redmiwatch3active;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.redmiwatch3;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.redmiwatch4;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.redmiwatch5active;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -0,0 +1,57 @@
/* Copyright (C) 2025 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 <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
public class RedmiWatch5Coordinator extends XiaomiCoordinator {
@Override
public int getDeviceNameResource() {
return R.string.devicetype_redmi_watch_5;
}
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("^Redmi Watch 5 [0-9A-F]{4}$");
}
@Override
public ConnectionType getConnectionType() {
// this device likely supports both connection types if we indicate
// that we are an iOS device in the final auth step
return ConnectionType.BT_CLASSIC;
}
@Override
public int getDefaultIconResource() {
return R.drawable.ic_device_amazfit_bip;
}
@Override
public int getWorldClocksSlotCount() {
return 20;
}
@Override
public int getContactsSlotCount(final GBDevice device) {
return 10;
}
}
@@ -14,7 +14,7 @@
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.xiaomi.redmiwatch5lite;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.watchs1active;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.watchs1;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.watchs1pro;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -14,7 +14,7 @@
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.xiaomi.watchs3;
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches;
import java.util.regex.Pattern;
@@ -287,6 +287,11 @@ import nodomain.freeyourgadget.gadgetbridge.devices.realme.RealmeBudsAir5ProCoor
import nodomain.freeyourgadget.gadgetbridge.devices.realme.RealmeBudsT100Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.realme.RealmeBudsT110Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.realme.RealmeBudsT300Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.redmibuds.RedmiBuds3ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.redmibuds.RedmiBuds4ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.redmibuds.RedmiBuds5ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.redmibuds.RedmiBuds6ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.redmibuds.RedmiBuds6ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.roidmi.Roidmi1Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.roidmi.Roidmi3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.scannable.ScannableDeviceCoordinator;
@@ -325,33 +330,29 @@ import nodomain.freeyourgadget.gadgetbridge.devices.vibratissimo.VibratissimoCoo
import nodomain.freeyourgadget.gadgetbridge.devices.waspos.WaspOSCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.watch9.Watch9DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.withingssteelhr.WithingsSteelHRDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband7pro.MiBand7ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8.MiBand8Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8active.MiBand8ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8pro.MiBand8ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband9.MiBand9Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband9active.MiBand9ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband9pro.MiBand9ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miwatch.MiWatchLiteCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miwatchcolorsport.MiWatchColorSportCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds.RedmiBuds3ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds.RedmiBuds4ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds.RedmiBuds5ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds.RedmiBuds6ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds.RedmiBuds6ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmismartband2.RedmiSmartBand2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmismartbandpro.RedmiSmartBandProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch2.RedmiWatch2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch2lite.RedmiWatch2LiteCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch3.RedmiWatch3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch3active.RedmiWatch3ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch4.RedmiWatch4Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch5active.RedmiWatch5ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch5lite.RedmiWatch5LiteCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watchs1.XiaomiWatchS1Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watchs1active.XiaomiWatchS1ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watchs1pro.XiaomiWatchS1ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watchs3.XiaomiWatchS3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiBand7ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiBand8ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiBand8Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiBand8ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiBand9ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiBand9Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiBand9ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiWatchColorSportCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiWatchLiteCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.RedmiSmartBand2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.RedmiSmartBandProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.RedmiWatch2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.RedmiWatch2LiteCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.RedmiWatch3ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.RedmiWatch3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.RedmiWatch4Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.RedmiWatch5ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.RedmiWatch5Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.RedmiWatch5LiteCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.XiaomiWatchS1ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.XiaomiWatchS1Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.XiaomiWatchS1ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.XiaomiWatchS3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xwatch.XWatchCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.yawell.ring.ColmiR02Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.yawell.ring.ColmiR03Coordinator;
@@ -434,6 +435,7 @@ public enum DeviceType {
REDMIWATCH2LITE(RedmiWatch2LiteCoordinator.class),
REDMISMARTBANDPRO(RedmiSmartBandProCoordinator.class),
REDMIWATCH4(RedmiWatch4Coordinator.class),
REDMIWATCH5(RedmiWatch5Coordinator.class),
REDMIWATCH5ACTIVE(RedmiWatch5ActiveCoordinator.class),
REDMIWATCH5LITE(RedmiWatch5LiteCoordinator.class),
XIAOMI_WATCH_S1_ACTIVE(XiaomiWatchS1ActiveCoordinator.class),
@@ -9,7 +9,7 @@ import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.Dev
import android.content.SharedPreferences;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds.prefs.Configuration;
import nodomain.freeyourgadget.gadgetbridge.devices.redmibuds.prefs.Configuration;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
public class RedmiBuds3ProProtocol extends RedmiBudsProtocol {
@@ -37,10 +37,10 @@ import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventBatteryInf
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventSendBytes;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventUpdateDeviceState;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventVersionInfo;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds.prefs.Configuration.Config;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds.prefs.Configuration.StrengthTarget;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds.prefs.Gestures.InteractionType;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmibuds.prefs.Gestures.Position;
import nodomain.freeyourgadget.gadgetbridge.devices.redmibuds.prefs.Configuration.Config;
import nodomain.freeyourgadget.gadgetbridge.devices.redmibuds.prefs.Configuration.StrengthTarget;
import nodomain.freeyourgadget.gadgetbridge.devices.redmibuds.prefs.Gestures.InteractionType;
import nodomain.freeyourgadget.gadgetbridge.devices.redmibuds.prefs.Gestures.Position;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice.State;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryState;
+1
View File
@@ -2012,6 +2012,7 @@
<string name="devicetype_redmi_watch_2_lite">Redmi Watch 2 Lite</string>
<string name="devicetype_redmi_smart_band_pro">Redmi Smart Band Pro</string>
<string name="devicetype_redmi_watch_4">Redmi Watch 4</string>
<string name="devicetype_redmi_watch_5">Redmi Watch 5</string>
<string name="devicetype_redmi_watch_5_active">Redmi Watch 5 Active</string>
<string name="devicetype_redmi_watch_5_lite">Redmi Watch 5 Lite</string>
<string name="devicetype_aawireless">AAWireless</string>