1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-22 06:41:06 +02:00

Redmi Watch 3 Lite: Initial support

This is just using mi band 8 code, some feature work
This commit is contained in:
Andreas Shimokawa 2023-11-25 20:33:02 +01:00 committed by José Rebelo
parent 0dcb316461
commit 84cf8efb59
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,63 @@
/* Copyright (C) 2023 Andreas Shimokawa
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.redmiwatch3active;
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.XiaomiEncryptedCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiInstallHandler;
public class RedmiWatch3ActiveCoordinator extends XiaomiEncryptedCoordinator {
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("^Redmi Watch 3 Active [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_redmiwatch3active;
}
@Override
public int getDefaultIconResource() {
return R.drawable.ic_device_amazfit_bip;
}
@Override
public int getDisabledIconResource() {
return R.drawable.ic_device_amazfit_bip_disabled;
}
@Override
public boolean supportsMultipleWeatherLocations() {
return true;
}
}

View File

@ -144,6 +144,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8.MiBand8Coordi
import nodomain.freeyourgadget.gadgetbridge.devices.xwatch.XWatchCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.zetime.ZeTimeCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miwatch.MiWatchLiteCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch3active.RedmiWatch3ActiveCoordinator;
/**
* For every supported device, a device type constant must exist.
@ -196,6 +197,7 @@ public enum DeviceType {
MIBAND7(MiBand7Coordinator.class),
MIBAND8(MiBand8Coordinator.class),
MIWATCHLITE(MiWatchLiteCoordinator.class),
REDMIWATCH3ACTIVE(RedmiWatch3ActiveCoordinator.class),
AMAZFITGTS3(AmazfitGTS3Coordinator.class),
AMAZFITGTR3(AmazfitGTR3Coordinator.class),
AMAZFITGTR4(AmazfitGTR4Coordinator.class),

View File

@ -1388,6 +1388,7 @@
<string name="devicetype_binary_sensor">Binary sensor</string>
<string name="devicetype_femometer_vinca2">Femometer Vinca II</string>
<string name="devicetype_xiaomi_watch_lite">Xiaomi Watch Lite</string>
<string name="devicetype_redmiwatch3active">Redmi Watch 3 Active</string>
<string name="choose_auto_export_location">Choose export location</string>
<string name="notification_channel_name">General</string>
<string name="notification_channel_high_priority_name">High-priority</string>