diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/HuamiConst.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/HuamiConst.java index d6caac90f..5dbabc6ab 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/HuamiConst.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/HuamiConst.java @@ -61,6 +61,7 @@ public class HuamiConst { public static final String AMAZFIT_NEO_NAME = "Amazfit Neo"; public static final String AMAZFIT_X = "Amazfit X"; public static final String AMAZFIT_BIP5_NAME = "Amazfit Bip 5"; + public static final String AMAZFIT_BIP5_UNITY_NAME = "Amazfit Bip 5 Unity"; public static final String AMAZFIT_GTS3_NAME = "Amazfit GTS 3"; public static final String AMAZFIT_GTS4_NAME = "Amazfit GTS 4"; public static final String AMAZFIT_GTS4_MINI_NAME = "Amazfit GTS 4 Mini"; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip5/AmazfitBip5Coordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip5/AmazfitBip5Coordinator.java index b21fac3ca..ef328eeea 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip5/AmazfitBip5Coordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip5/AmazfitBip5Coordinator.java @@ -56,16 +56,6 @@ public class AmazfitBip5Coordinator extends ZeppOsCoordinator { return true; } - @Override - public boolean supportsWifiHotspot(final GBDevice device) { - return false; - } - - @Override - public boolean supportsFtpServer(final GBDevice device) { - return false; - } - @Override public boolean supportsBluetoothPhoneCalls(final GBDevice device) { return true; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip5unity/AmazfitBip5UnityCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip5unity/AmazfitBip5UnityCoordinator.java new file mode 100644 index 000000000..b64b04098 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip5unity/AmazfitBip5UnityCoordinator.java @@ -0,0 +1,79 @@ +/* Copyright (C) 2023-2024 Daniel Dakhno, 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 . */ +package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip5unity; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import nodomain.freeyourgadget.gadgetbridge.R; +import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst; +import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator; +import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; + +public class AmazfitBip5UnityCoordinator extends ZeppOsCoordinator { + @Override + public boolean isExperimental() { + // untested device + return true; + } + + @Override + public String getDeviceBluetoothName() { + return HuamiConst.AMAZFIT_BIP5_UNITY_NAME; + } + + @Override + public Set getDeviceSources() { + return new HashSet<>(Arrays.asList(8782081, 8782088, 8782089)); + } + + @Override + public boolean supportsContinuousFindDevice() { + return true; + } + + @Override + public boolean supportsControlCenter() { + return true; + } + + @Override + public boolean supportsToDoList() { + return true; + } + + @Override + public boolean supportsBluetoothPhoneCalls(final GBDevice device) { + return true; + } + + @Override + public int getDeviceNameResource() { + return R.string.devicetype_amazfit_bip5_unity; + } + + @Override + public int getDefaultIconResource() { + return R.drawable.ic_device_amazfit_bip; + } + + @Override + public int getDisabledIconResource() { + return R.drawable.ic_device_amazfit_bip_disabled; + } +} 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 9cafb6a01..a80944d88 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -65,6 +65,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip.AmazfitBipL import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip3.AmazfitBip3Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip3pro.AmazfitBip3ProCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip5.AmazfitBip5Coordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip5unity.AmazfitBip5UnityCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbips.AmazfitBipSCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbips.AmazfitBipSLiteCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbipu.AmazfitBipUCoordinator; @@ -283,6 +284,7 @@ public enum DeviceType { AMAZFITCHEETAHSQUARE(AmazfitCheetahSquareCoordinator.class), AMAZFITCHEETAHROUND(AmazfitCheetahRoundCoordinator.class), AMAZFITBIP5(AmazfitBip5Coordinator.class), + AMAZFITBIP5UNITY(AmazfitBip5UnityCoordinator.class), AMAZFITTREXULTRA(AmazfitTRexUltraCoordinator.class), AMAZFITGTRMINI(AmazfitGTRMiniCoordinator.class), AMAZFITFALCON(AmazfitFalconCoordinator.class), diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index eed9db4b0..ecfc29ecd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1457,6 +1457,7 @@ Amazfit Bip 3 Amazfit Bip 3 Pro Amazfit Bip 5 + Amazfit Bip 5 Unity Amazfit GTR 4 Amazfit T-Rex 2 Amazfit T-Rex Ultra