From 682113360e0e6c0641c0c468a379d7e8fb7fd455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Sat, 6 Sep 2025 15:19:31 +0100 Subject: [PATCH] Y66: Initial support --- .../gloryfit/watches/Y66Coordinator.kt | 41 +++++++++++++++++++ .../gadgetbridge/model/DeviceType.java | 2 + app/src/main/res/values/strings.xml | 1 + .../AbstractDeviceCoordinatorTest.java | 1 + 4 files changed, 45 insertions(+) create mode 100644 app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/gloryfit/watches/Y66Coordinator.kt diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/gloryfit/watches/Y66Coordinator.kt b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/gloryfit/watches/Y66Coordinator.kt new file mode 100644 index 0000000000..417a3b0eed --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/gloryfit/watches/Y66Coordinator.kt @@ -0,0 +1,41 @@ +/* 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 . */ +package nodomain.freeyourgadget.gadgetbridge.devices.gloryfit.watches + +import nodomain.freeyourgadget.gadgetbridge.R +import nodomain.freeyourgadget.gadgetbridge.devices.gloryfit.GloryFitCoordinator +import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice +import java.util.regex.Pattern + +class Y66Coordinator : GloryFitCoordinator() { + override fun getManufacturer(): String { + return "Unspecified" + } + + override fun getSupportedDeviceName(): Pattern? { + return Pattern.compile("^Y66\\(ID-[0-9A-F]{4}\\)$") + } + + override fun getDeviceNameResource(): Int { + return R.string.devicetype_y66 + } + + override fun getAlarmSlotCount(device: GBDevice): Int { + // alarms from app are not supported as per #5063 + return 0 + } +} 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 ad6517d479..0fd5681cbe 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -151,6 +151,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.generic_scale.GenericWeightS import nodomain.freeyourgadget.gadgetbridge.devices.gloryfit.watches.DotnP66DCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.gloryfit.watches.HaylouWatch2ProCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.gloryfit.watches.OukitelBT103Coordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.gloryfit.watches.Y66Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.gree.GreeAcCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.hama.fit6900.HamaFit6900DeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.hplus.EXRIZUK8Coordinator; @@ -740,6 +741,7 @@ public enum DeviceType { OUKITEL_BT103(OukitelBT103Coordinator.class), DOTN_P66D(DotnP66DCoordinator.class), HAYLOU_WATCH_2_PRO(HaylouWatch2ProCoordinator.class), + Y66(Y66Coordinator.class), REALME_BUDS_T110(RealmeBudsT110Coordinator.class), REALME_BUDS_T100(RealmeBudsT100Coordinator.class), REALME_BUDS_T300(RealmeBudsT300Coordinator.class), diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 75aedec2ac..b03e1c6de3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -4262,6 +4262,7 @@ Gadgetbridge Notification Monitor Monitoring notifications in background Oukitel BT103 + Y66 Haylou Watch 2 Pro Dotn P66D Time interval diff --git a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/devices/AbstractDeviceCoordinatorTest.java b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/devices/AbstractDeviceCoordinatorTest.java index c85835213e..84d0e7d7e2 100644 --- a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/devices/AbstractDeviceCoordinatorTest.java +++ b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/devices/AbstractDeviceCoordinatorTest.java @@ -52,6 +52,7 @@ public class AbstractDeviceCoordinatorTest extends TestBase { put("P8", DeviceType.WASPOS); put("P8DFU", DeviceType.WASPOS); put("P80", DeviceType.COLMI_P80); + put("Y66", DeviceType.Y66); put("R11C_B200", DeviceType.YAWELL_R11); put("R11_B200", DeviceType.YAWELL_R11); put("WF-C710N", DeviceType.SONY_WF_C710N);