From d66f0cdd2214edb2789f8a5517a1e3d86f07c809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Fri, 26 Jul 2024 10:16:46 +0100 Subject: [PATCH] Vivitar HR & BP Monitor Activity Tracker: Initial support --- ...HrBpMonitorActivityTrackerCoordinator.java | 61 +++++++++++++++++++ .../gadgetbridge/model/DeviceType.java | 2 + app/src/main/res/values/strings.xml | 1 + 3 files changed, 64 insertions(+) create mode 100644 app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/lefun/VivitarHrBpMonitorActivityTrackerCoordinator.java diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/lefun/VivitarHrBpMonitorActivityTrackerCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/lefun/VivitarHrBpMonitorActivityTrackerCoordinator.java new file mode 100644 index 000000000..137769b79 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/lefun/VivitarHrBpMonitorActivityTrackerCoordinator.java @@ -0,0 +1,61 @@ +/* Copyright (C) 2024 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.lefun; + +import nodomain.freeyourgadget.gadgetbridge.R; +import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; +import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate; + +public class VivitarHrBpMonitorActivityTrackerCoordinator extends LefunDeviceCoordinator { + public boolean supports(GBDeviceCandidate candidate) { + // Since the Lefun coordinator overrides supports, we also need to + return "IMP-2027".equals(candidate.getName()); + } + + @Override + public int[] getSupportedDeviceSpecificSettings(GBDevice device) { + return new int[]{ + R.xml.devicesettings_liftwrist_display_noshed, + R.xml.devicesettings_timeformat, + // R.xml.devicesettings_antilost, not supported + R.xml.devicesettings_inactivity, + R.xml.devicesettings_hydration_reminder, + R.xml.devicesettings_lefun_interface_language, + R.xml.devicesettings_transliteration + }; + } + + @Override + public boolean supportsRealtimeData() { + return false; // not supported + } + + @Override + public int getDeviceNameResource() { + return R.string.devicetype_vivitar_hr_bp_monitor_activity_tracker; + } + + @Override + public int getDefaultIconResource() { + return R.drawable.ic_device_h30_h10; + } + + @Override + public int getDisabledIconResource() { + return R.drawable.ic_device_h30_h10_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 69d2a3160..135544187 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -173,6 +173,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.jyou.TeclastH30.TeclastH30Co import nodomain.freeyourgadget.gadgetbridge.devices.jyou.y5.Y5Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.lefun.BohemicSmartBraceletDeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.lefun.LefunDeviceCoordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.lefun.VivitarHrBpMonitorActivityTrackerCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.lenovo.watchxplus.WatchXPlusDeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.liveview.LiveviewCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.makibeshr3.MakibesHR3Coordinator; @@ -357,6 +358,7 @@ public enum DeviceType { MIJIA_LYWSD03(MijiaLywsd03Coordinator.class), MIJIA_MHO_C303(MijiaMhoC303Coordinator.class), LEFUN(LefunDeviceCoordinator.class), + VIVITAR_HR_BP_MONITOR_ACTIVITY_TRACKER(VivitarHrBpMonitorActivityTrackerCoordinator.class), BOHEMIC_SMART_BRACELET(BohemicSmartBraceletDeviceCoordinator.class), SMAQ2OSS(SMAQ2OSSCoordinator.class), FITPRO(FitProDeviceCoordinator.class), diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 93bf9a2c9..a35e15fc9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1640,6 +1640,7 @@ Lemfo SG2 Lefun Bohemic Smart Bracelet + Vivitar HR & BP Monitor Activity Tracker Hama Fit6900 Nothing