Amazfit Active 2 Square: Experimental support

This commit is contained in:
José Rebelo
2025-07-04 10:02:03 +01:00
parent 83db1c98ff
commit 848454c871
5 changed files with 81 additions and 5 deletions
@@ -23,7 +23,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
* This seems to be the same as the Active 2, but with NFC. The bluetooth name is different, but the
* device sources seem to be similar.
*/
public class AmazfitActive2NfcCoordinator extends AmazfitActive2Coordinator {
public class AmazfitActive2NfcCoordinator extends AmazfitActive2RoundCoordinator {
@Override
public String getDeviceBluetoothName() {
return HuamiConst.AMAZFIT_ACTIVE_2_NFC_NAME;
@@ -25,7 +25,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
public class AmazfitActive2Coordinator extends ZeppOsCoordinator {
public class AmazfitActive2RoundCoordinator extends ZeppOsCoordinator {
@Override
public String getDeviceBluetoothName() {
return HuamiConst.AMAZFIT_ACTIVE_2_NAME;
@@ -47,7 +47,7 @@ public class AmazfitActive2Coordinator extends ZeppOsCoordinator {
@Override
public int getDeviceNameResource() {
return R.string.devicetype_amazfit_active_2;
return R.string.devicetype_amazfit_active_2_round;
}
@Override
@@ -0,0 +1,72 @@
/* 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.huami.zeppos.watches;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
public class AmazfitActive2SquareCoordinator extends ZeppOsCoordinator {
@Override
public boolean isExperimental() {
// untested
return true;
}
@Override
public String getDeviceBluetoothName() {
return "Active 2 (Square)";
}
@Override
public Set<Integer> getDeviceSources() {
return new HashSet<>(Arrays.asList(
9830656, // chinese mainland version
9830657,
9830659
));
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_amazfit_active_2_square;
}
@Override
public boolean mainMenuHasMoreSection() {
return false;
}
@Override
public boolean supportsControlCenter() {
return true;
}
@Override
public boolean supportsToDoList() {
return true;
}
@Override
public boolean supportsBluetoothPhoneCalls(final GBDevice device) {
return true;
}
}
@@ -174,8 +174,9 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.miband5.MiBand5Coordin
import nodomain.freeyourgadget.gadgetbridge.devices.huami.miband6.MiBand6Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppe.ZeppECoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.straps.AmazfitHelioStrapCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitActive2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitActive2RoundCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitActive2NfcCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitActive2SquareCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitActiveEdgeCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitBalance2Coordinator;
@@ -471,8 +472,9 @@ public enum DeviceType {
AMAZFITBALANCE(AmazfitBalanceCoordinator.class),
AMAZFITBALANCE2(AmazfitBalance2Coordinator.class),
AMAZFITACTIVE(AmazfitActiveCoordinator.class),
AMAZFITACTIVE2(AmazfitActive2Coordinator.class),
AMAZFITACTIVE2(AmazfitActive2RoundCoordinator.class),
AMAZFITACTIVE2NFC(AmazfitActive2NfcCoordinator.class),
AMAZFITACTIVE2SQUARE(AmazfitActive2SquareCoordinator.class),
AMAZFITACTIVEEDGE(AmazfitActiveEdgeCoordinator.class),
AMAZFITHELIOSTRAP(AmazfitHelioStrapCoordinator.class),
HPLUS(HPlusCoordinator.class),
+2
View File
@@ -1780,6 +1780,8 @@
<string name="devicetype_amazfit_balance_2">Amazfit Balance 2</string>
<string name="devicetype_amazfit_active">Amazfit Active</string>
<string name="devicetype_amazfit_active_2">Amazfit Active 2</string>
<string name="devicetype_amazfit_active_2_round">Amazfit Active 2 (Round)</string>
<string name="devicetype_amazfit_active_2_square">Amazfit Active 2 (Square)</string>
<string name="devicetype_amazfit_active_2_nfc">Amazfit Active 2 NFC</string>
<string name="devicetype_amazfit_active_edge">Amazfit Active Edge</string>
<string name="devicetype_amazfit_cheetah_square">Amazfit Cheetah (Square)</string>