mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-03 17:02:13 +01:00
Redmi Smart Band 2: Experimental support
Characteristics taken from #3274
This commit is contained in:
parent
621fa21367
commit
108307c711
@ -100,6 +100,7 @@ vendor's servers.
|
|||||||
- [Xiaomi Smart Band 8 (experimental)](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Mi-Band-8) [**\[!\]**](#special-pairing-procedures)
|
- [Xiaomi Smart Band 8 (experimental)](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Mi-Band-8) [**\[!\]**](#special-pairing-procedures)
|
||||||
- Mi Watch Color Sport (experimental)
|
- Mi Watch Color Sport (experimental)
|
||||||
- Mi Watch Lite (experimental)
|
- Mi Watch Lite (experimental)
|
||||||
|
- Redmi Smart Band 2 (experimental) [**\[!\]**](#special-pairing-procedures)
|
||||||
- Redmi Watch 3 Active (experimental) [**\[!\]**](#special-pairing-procedures)
|
- Redmi Watch 3 Active (experimental) [**\[!\]**](#special-pairing-procedures)
|
||||||
- Watch S1 Active (experimental) [**\[!\]**](#special-pairing-procedures)
|
- Watch S1 Active (experimental) [**\[!\]**](#special-pairing-procedures)
|
||||||
- Xiaomi Temperature and Humidity Monitor Clock (LYWSD02/LYWSD02MMC) (partial support)
|
- Xiaomi Temperature and Humidity Monitor Clock (LYWSD02/LYWSD02MMC) (partial support)
|
||||||
|
@ -0,0 +1,63 @@
|
|||||||
|
/* Copyright (C) 2023 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 <http://www.gnu.org/licenses/>. */
|
||||||
|
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmismartband2;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.net.Uri;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiCoordinator;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiInstallHandler;
|
||||||
|
|
||||||
|
public class RedmiSmartBand2Coordinator extends XiaomiCoordinator {
|
||||||
|
@Override
|
||||||
|
public boolean isExperimental() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Pattern getSupportedDeviceName() {
|
||||||
|
return Pattern.compile("^Redmi Smart Band 2 [A-Z0-9]{4}$");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public InstallHandler findInstallHandler(final Uri uri, final Context context) {
|
||||||
|
final XiaomiInstallHandler handler = new XiaomiInstallHandler(uri, context);
|
||||||
|
return handler.isValid() ? handler : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getDeviceNameResource() {
|
||||||
|
return R.string.devicetype_redmi_smart_band_2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getDefaultIconResource() {
|
||||||
|
return R.drawable.ic_device_default;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getDisabledIconResource() {
|
||||||
|
return R.drawable.ic_device_default_disabled;
|
||||||
|
}
|
||||||
|
}
|
@ -144,6 +144,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.withingssteelhr.WithingsStee
|
|||||||
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband7pro.MiBand7ProCoordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband7pro.MiBand7ProCoordinator;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8.MiBand8Coordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8.MiBand8Coordinator;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miwatchcolorsport.MiWatchColorSportCoordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miwatchcolorsport.MiWatchColorSportCoordinator;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmismartband2.RedmiSmartBand2Coordinator;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watchs1active.XiaomiWatchS1ActiveCoordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watchs1active.XiaomiWatchS1ActiveCoordinator;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.xwatch.XWatchCoordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.xwatch.XWatchCoordinator;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.zetime.ZeTimeCoordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.zetime.ZeTimeCoordinator;
|
||||||
@ -204,6 +205,7 @@ public enum DeviceType {
|
|||||||
MIWATCHLITE(MiWatchLiteCoordinator.class),
|
MIWATCHLITE(MiWatchLiteCoordinator.class),
|
||||||
MIWATCHCOLORSPORT(MiWatchColorSportCoordinator.class),
|
MIWATCHCOLORSPORT(MiWatchColorSportCoordinator.class),
|
||||||
REDMIWATCH3ACTIVE(RedmiWatch3ActiveCoordinator.class),
|
REDMIWATCH3ACTIVE(RedmiWatch3ActiveCoordinator.class),
|
||||||
|
REDMISMARTBAND2(RedmiSmartBand2Coordinator.class),
|
||||||
XIAOMI_WATCH_S1_ACTIVE(XiaomiWatchS1ActiveCoordinator.class),
|
XIAOMI_WATCH_S1_ACTIVE(XiaomiWatchS1ActiveCoordinator.class),
|
||||||
AMAZFITGTS3(AmazfitGTS3Coordinator.class),
|
AMAZFITGTS3(AmazfitGTS3Coordinator.class),
|
||||||
AMAZFITGTR3(AmazfitGTR3Coordinator.class),
|
AMAZFITGTR3(AmazfitGTR3Coordinator.class),
|
||||||
|
@ -26,6 +26,7 @@ public class XiaomiBleUuids {
|
|||||||
// Mi Band 8
|
// Mi Band 8
|
||||||
// Redmi Watch 3 Active
|
// Redmi Watch 3 Active
|
||||||
// Xiaomi Watch S1 Active
|
// Xiaomi Watch S1 Active
|
||||||
|
// Redmi Smart Band 2
|
||||||
put(UUID.fromString("0000fe95-0000-1000-8000-00805f9b34fb"), new XiaomiBleUuidSet(
|
put(UUID.fromString("0000fe95-0000-1000-8000-00805f9b34fb"), new XiaomiBleUuidSet(
|
||||||
true,
|
true,
|
||||||
UUID.fromString("00000051-0000-1000-8000-00805f9b34fb"),
|
UUID.fromString("00000051-0000-1000-8000-00805f9b34fb"),
|
||||||
|
@ -1415,6 +1415,7 @@
|
|||||||
<string name="devicetype_femometer_vinca2">Femometer Vinca II</string>
|
<string name="devicetype_femometer_vinca2">Femometer Vinca II</string>
|
||||||
<string name="devicetype_xiaomi_watch_lite">Xiaomi Watch Lite</string>
|
<string name="devicetype_xiaomi_watch_lite">Xiaomi Watch Lite</string>
|
||||||
<string name="devicetype_redmiwatch3active">Redmi Watch 3 Active</string>
|
<string name="devicetype_redmiwatch3active">Redmi Watch 3 Active</string>
|
||||||
|
<string name="devicetype_redmi_smart_band_2">Redmi Smart Band 2</string>
|
||||||
<string name="choose_auto_export_location">Choose export location</string>
|
<string name="choose_auto_export_location">Choose export location</string>
|
||||||
<string name="notification_channel_name">General</string>
|
<string name="notification_channel_name">General</string>
|
||||||
<string name="notification_channel_high_priority_name">High-priority</string>
|
<string name="notification_channel_high_priority_name">High-priority</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user