Bohemic Smart Bracelet: Initial support

This commit is contained in:
José Rebelo 2023-07-09 13:37:18 +01:00 committed by José Rebelo
parent 298dbbe777
commit 3da539be23
6 changed files with 68 additions and 0 deletions

View File

@ -72,6 +72,8 @@ vendor's servers.
- [iTag](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/iTag)
- JYou Y5
- Lefun
- Lefun ID115 Plus
- Other clones: bohemic smart bracelet
- Lenovo
- Watch 9
- [Watch X (Plus)](https://codeberg.org/mamutcho/Gadgetbridge/wiki)

View File

@ -0,0 +1,60 @@
/* Copyright (C) 2016-2021 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, José Rebelo, Petr Kadlec, protomors, Yukai Li
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.lefun;
import androidx.annotation.NonNull;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
public class BohemicSmartBraceletDeviceCoordinator extends LefunDeviceCoordinator {
@NonNull
@Override
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
if (".bohemic".equals(candidate.getName())) {
return DeviceType.BOHEMIC_SMART_BRACELET;
}
return DeviceType.UNKNOWN;
}
@Override
public DeviceType getDeviceType() {
return DeviceType.BOHEMIC_SMART_BRACELET;
}
@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
}
}

View File

@ -101,6 +101,7 @@ public enum DeviceType {
PINETIME_JF(190, R.drawable.ic_device_pinetime, R.drawable.ic_device_pinetime_disabled, R.string.devicetype_pinetime_jf),
MIJIA_LYWSD02(200, R.drawable.ic_device_pebble, R.drawable.ic_device_pebble_disabled, R.string.devicetype_mijia_lywsd02),
LEFUN(210, R.drawable.ic_device_h30_h10, R.drawable.ic_device_h30_h10_disabled, R.string.devicetype_lefun),
BOHEMIC_SMART_BRACELET(211, R.drawable.ic_device_h30_h10, R.drawable.ic_device_h30_h10_disabled, R.string.devicetype_bohemic_smart_bracelet),
SMAQ2OSS(220, R.drawable.ic_device_default, R.drawable.ic_device_default, R.string.devicetype_smaq2oss),
FITPRO(230, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_fitpro),
ITAG(250, R.drawable.ic_device_itag, R.drawable.ic_device_itag_disabled, R.string.devicetype_itag),

View File

@ -317,6 +317,8 @@ public class DeviceSupportFactory {
return new ServiceDeviceSupport(new HPlusSupport(DeviceType.SG2));
case LEFUN:
return new ServiceDeviceSupport(new LefunDeviceSupport());
case BOHEMIC_SMART_BRACELET:
return new ServiceDeviceSupport(new LefunDeviceSupport());
case SONY_SWR12:
return new ServiceDeviceSupport(new SonySWR12DeviceSupport());
case WASPOS:

View File

@ -48,6 +48,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr3pro.Amazfit
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts4.AmazfitGTS4Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts4mini.AmazfitGTS4MiniCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfittrex2.AmazfitTRex2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.lefun.BohemicSmartBraceletDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyLinkBudsSCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.soflow.SoFlowCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM5Coordinator;
@ -344,6 +345,7 @@ public class DeviceHelper {
result.add(new PineTimeJFCoordinator());
result.add(new SG2Coordinator());
result.add(new LefunDeviceCoordinator());
result.add(new BohemicSmartBraceletDeviceCoordinator());
result.add(new SonySWR12DeviceCoordinator());
result.add(new WaspOSCoordinator());
result.add(new SMAQ2OSSCoordinator());

View File

@ -1324,6 +1324,7 @@
<string name="devicetype_amazfit_vergel">Amazfit Verge Lite</string>
<string name="devicetype_sg2">Lemfo SG2</string>
<string name="devicetype_lefun">Lefun</string>
<string name="devicetype_bohemic_smart_bracelet">Bohemic Smart Bracelet</string>
<!-- Menus on the smart device -->
<string name="menuitem_nothing">Nothing</string>
<string name="menuitem_status">Status</string>