mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-01 06:22:55 +01:00
Added support for Q8 devices
This commit is contained in:
parent
d1368c2ed8
commit
3852f925da
@ -0,0 +1,55 @@
|
|||||||
|
/* Copyright (C) 2017-2018 Alejandro Ladera Chamorro
|
||||||
|
|
||||||
|
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.hplus;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @author Alejandro Ladera Chamorro <11555126+tiparega@users.noreply.github.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pseudo Coordinator for the Q8, a sub type of the HPLUS devices
|
||||||
|
*/
|
||||||
|
public class Q8Coordinator extends HPlusCoordinator {
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||||
|
String name = candidate.getDevice().getName();
|
||||||
|
if(name != null && name.startsWith("Q8")){
|
||||||
|
return DeviceType.Q8;
|
||||||
|
}
|
||||||
|
|
||||||
|
return DeviceType.UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeviceType getDeviceType() {
|
||||||
|
return DeviceType.Q8;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getManufacturer() {
|
||||||
|
return "Makibes";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -40,6 +40,7 @@ public enum DeviceType {
|
|||||||
HPLUS(40, R.drawable.ic_device_hplus, R.drawable.ic_device_hplus_disabled, R.string.devicetype_hplus),
|
HPLUS(40, R.drawable.ic_device_hplus, R.drawable.ic_device_hplus_disabled, R.string.devicetype_hplus),
|
||||||
MAKIBESF68(41, R.drawable.ic_device_hplus, R.drawable.ic_device_hplus_disabled, R.string.devicetype_makibes_f68),
|
MAKIBESF68(41, R.drawable.ic_device_hplus, R.drawable.ic_device_hplus_disabled, R.string.devicetype_makibes_f68),
|
||||||
EXRIZUK8(42, R.drawable.ic_device_hplus, R.drawable.ic_device_hplus_disabled, R.string.devicetype_exrizu_k8),
|
EXRIZUK8(42, R.drawable.ic_device_hplus, R.drawable.ic_device_hplus_disabled, R.string.devicetype_exrizu_k8),
|
||||||
|
Q8(43, R.drawable.ic_device_hplus, R.drawable.ic_device_hplus_disabled, R.string.devicetype_q8),
|
||||||
NO1F1(50, R.drawable.ic_device_hplus, R.drawable.ic_device_hplus_disabled, R.string.devicetype_no1_f1),
|
NO1F1(50, R.drawable.ic_device_hplus, R.drawable.ic_device_hplus_disabled, R.string.devicetype_no1_f1),
|
||||||
TECLASTH30(60, R.drawable.ic_device_h30_h10, R.drawable.ic_device_h30_h10_disabled, R.string.devicetype_teclast_h30),
|
TECLASTH30(60, R.drawable.ic_device_h30_h10, R.drawable.ic_device_h30_h10_disabled, R.string.devicetype_teclast_h30),
|
||||||
XWATCH(70, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_xwatch),
|
XWATCH(70, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_xwatch),
|
||||||
|
@ -136,6 +136,9 @@ public class DeviceSupportFactory {
|
|||||||
case EXRIZUK8:
|
case EXRIZUK8:
|
||||||
deviceSupport = new ServiceDeviceSupport(new HPlusSupport(DeviceType.EXRIZUK8), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
|
deviceSupport = new ServiceDeviceSupport(new HPlusSupport(DeviceType.EXRIZUK8), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
|
||||||
break;
|
break;
|
||||||
|
case Q8:
|
||||||
|
deviceSupport = new ServiceDeviceSupport(new HPlusSupport(DeviceType.Q8), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
|
||||||
|
break;
|
||||||
case NO1F1:
|
case NO1F1:
|
||||||
deviceSupport = new ServiceDeviceSupport(new No1F1Support(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
|
deviceSupport = new ServiceDeviceSupport(new No1F1Support(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
|
||||||
break;
|
break;
|
||||||
|
@ -43,6 +43,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.UnknownDeviceCoordinator;
|
|||||||
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.EXRIZUK8Coordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.EXRIZUK8Coordinator;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.HPlusCoordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.HPlusCoordinator;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.MakibesF68Coordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.MakibesF68Coordinator;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.Q8Coordinator;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip.AmazfitBipCoordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip.AmazfitBipCoordinator;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitcor.AmazfitCorCoordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitcor.AmazfitCorCoordinator;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.miband2.MiBand2Coordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.huami.miband2.MiBand2Coordinator;
|
||||||
@ -203,6 +204,7 @@ public class DeviceHelper {
|
|||||||
result.add(new HPlusCoordinator());
|
result.add(new HPlusCoordinator());
|
||||||
result.add(new No1F1Coordinator());
|
result.add(new No1F1Coordinator());
|
||||||
result.add(new MakibesF68Coordinator());
|
result.add(new MakibesF68Coordinator());
|
||||||
|
result.add(new Q8Coordinator());
|
||||||
result.add(new EXRIZUK8Coordinator());
|
result.add(new EXRIZUK8Coordinator());
|
||||||
result.add(new TeclastH30Coordinator());
|
result.add(new TeclastH30Coordinator());
|
||||||
result.add(new XWatchCoordinator());
|
result.add(new XWatchCoordinator());
|
||||||
|
@ -550,6 +550,7 @@
|
|||||||
<string name="devicetype_hplus">HPlus</string>
|
<string name="devicetype_hplus">HPlus</string>
|
||||||
<string name="devicetype_makibes_f68">Makibes F68</string>
|
<string name="devicetype_makibes_f68">Makibes F68</string>
|
||||||
<string name="devicetype_exrizu_k8">Exrizu K8</string>
|
<string name="devicetype_exrizu_k8">Exrizu K8</string>
|
||||||
|
<string name="devicetype_q8">Q8</string>
|
||||||
<string name="devicetype_no1_f1">No.1 F1</string>
|
<string name="devicetype_no1_f1">No.1 F1</string>
|
||||||
<string name="devicetype_teclast_h30">Teclast H30</string>
|
<string name="devicetype_teclast_h30">Teclast H30</string>
|
||||||
<string name="devicetype_xwatch">XWatch</string>
|
<string name="devicetype_xwatch">XWatch</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user