mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Huawei: Add calories support
These devices provide calories instead of kcal, which are rounded per-sample, resulting in a slight difference from what is shown on the device itself.
This commit is contained in:
parent
b31832a72e
commit
d807909b25
@ -1363,7 +1363,7 @@ public class GBDaoGenerator {
|
||||
activitySample.addIntProperty("calories").notNull().codeBeforeGetter(
|
||||
"@Override\n" +
|
||||
" public int getActiveCalories() {\n" +
|
||||
" return getCalories();\n" +
|
||||
" return getCalories() == HuaweiActivitySample.NOT_MEASURED ? HuaweiActivitySample.NOT_MEASURED : Math.round(getCalories() / 1000f);\n" +
|
||||
" }\n"
|
||||
);
|
||||
activitySample.addIntProperty("distance").notNull().codeBeforeGetter(
|
||||
|
@ -163,6 +163,11 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActiveCalories() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return true;
|
||||
|
@ -172,6 +172,11 @@ public abstract class HuaweiLECoordinator extends AbstractBLEDeviceCoordinator i
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActiveCalories() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user