mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Garmin HRM 200: Initial support
This commit is contained in:
Generated
+1
@@ -31,6 +31,7 @@
|
||||
<w>chamorro</w>
|
||||
<w>codeberg</w>
|
||||
<w>colmi</w>
|
||||
<w>coospo</w>
|
||||
<w>criogenic</w>
|
||||
<w>croisez</w>
|
||||
<w>dakhno</w>
|
||||
|
||||
+1
@@ -3,6 +3,7 @@ package nodomain.freeyourgadget.gadgetbridge.devices.coospo
|
||||
import nodomain.freeyourgadget.gadgetbridge.R
|
||||
import java.util.regex.Pattern
|
||||
|
||||
/// #5025
|
||||
class CoospoH6Coordinator: CoospoHeartRateCoordinator() {
|
||||
override fun getSupportedDeviceName(): Pattern? {
|
||||
return Pattern.compile("^H6M [0-9]{5}$")
|
||||
|
||||
+1
@@ -3,6 +3,7 @@ package nodomain.freeyourgadget.gadgetbridge.devices.coospo
|
||||
import nodomain.freeyourgadget.gadgetbridge.R
|
||||
import java.util.regex.Pattern
|
||||
|
||||
/// #5110
|
||||
class CoospoHW9Coordinator: CoospoHeartRateCoordinator() {
|
||||
override fun getSupportedDeviceName(): Pattern? {
|
||||
return Pattern.compile("^HW9 [0-9]{5}$")
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.garmin.hrm
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R
|
||||
import java.util.regex.Pattern
|
||||
|
||||
/// #5110
|
||||
class GarminHrm200Coordinator: GarminHrmCoordinator() {
|
||||
override fun getSupportedDeviceName(): Pattern? {
|
||||
return Pattern.compile("^HRM 200$")
|
||||
}
|
||||
|
||||
override fun getDeviceNameResource(): Int {
|
||||
return R.string.devicetype_garmin_hrm_200
|
||||
}
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.garmin.hrm
|
||||
|
||||
import de.greenrobot.dao.AbstractDao
|
||||
import de.greenrobot.dao.Property
|
||||
import nodomain.freeyourgadget.gadgetbridge.R
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.generic_hr.GenericHeartRateActivitySampleProvider
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.AbstractActivitySample
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.GenericHeartRateSampleDao
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.generic_hr.GenericHeartRateSupport
|
||||
|
||||
/**
|
||||
* This class pulls most of the logic from the
|
||||
* {@link nodomain.freeyourgadget.gadgetbridge.devices.generic_hr.GenericHeartRateCoordinator}.
|
||||
*/
|
||||
abstract class GarminHrmCoordinator: AbstractBLEDeviceCoordinator() {
|
||||
override fun isExperimental(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun getBondingStyle(): Int {
|
||||
return BONDING_STYLE_NONE
|
||||
}
|
||||
|
||||
override fun suggestUnbindBeforePair(): Boolean {
|
||||
// Not needed
|
||||
return false
|
||||
}
|
||||
|
||||
override fun getManufacturer(): String {
|
||||
return "Garmin"
|
||||
}
|
||||
|
||||
override fun getDeviceSupportClass(device: GBDevice?): Class<out DeviceSupport> {
|
||||
return GenericHeartRateSupport::class.java
|
||||
}
|
||||
|
||||
override fun getDefaultIconResource(): Int {
|
||||
return R.drawable.ic_device_lovetoy
|
||||
}
|
||||
|
||||
override fun supportsHeartRateMeasurement(device: GBDevice): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun supportsActivityTracking(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun supportsActivityTabs(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun supportsSleepMeasurement(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun supportsStepCounter(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun supportsSpeedzones(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun getSampleProvider(device: GBDevice, session: DaoSession): SampleProvider<out AbstractActivitySample>? {
|
||||
return GenericHeartRateActivitySampleProvider(device, session)
|
||||
}
|
||||
|
||||
override fun getAllDeviceDao(session: DaoSession): MutableMap<AbstractDao<*, *>, Property> {
|
||||
return object : HashMap<AbstractDao<*, *>, Property>() {
|
||||
init {
|
||||
put(session.genericHeartRateSampleDao, GenericHeartRateSampleDao.Properties.DeviceId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,6 +63,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds.GalaxyBudsProDev
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.bike.GarminEdge130PlusCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.bike.GarminEdgeExplore2Coordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.gps.GarminETrexSeCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.hrm.GarminHrm200Coordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.descent.GarminDescentMk3Coordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.enduro.GarminEnduro3Coordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.epix.GarminEpixProCoordinator;
|
||||
@@ -540,6 +541,7 @@ public enum DeviceType {
|
||||
IKEA_IDASEN(IdasenCoordinator.class),
|
||||
NUTMINI(NutCoordinator.class),
|
||||
VIVOMOVE_HR(GarminVivomoveHrCoordinator.class),
|
||||
GARMIN_HRM_200(GarminHrm200Coordinator.class),
|
||||
GARMIN_EDGE_130_PLUS(GarminEdge130PlusCoordinator.class),
|
||||
GARMIN_EDGE_EXPLORE_2(GarminEdgeExplore2Coordinator.class),
|
||||
GARMIN_ETREX_SE(GarminETrexSeCoordinator.class),
|
||||
|
||||
@@ -2107,6 +2107,7 @@
|
||||
<string name="devicetype_generic_heart_rate_sensor">Heart Rate Sensor</string>
|
||||
<string name="devicetype_coospo_h6">Coospo H6</string>
|
||||
<string name="devicetype_coospo_hw9">Coospo HW9</string>
|
||||
<string name="devicetype_garmin_hrm_200">Garmin HRM 200</string>
|
||||
<!-- Menus on the smart device -->
|
||||
<string name="menuitem_nothing">Nothing</string>
|
||||
<string name="menuitem_status">Status</string>
|
||||
|
||||
Reference in New Issue
Block a user