1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-04 12:02:06 +02:00

Bangle.js: Allow an activity sample to have a time specified - first steps in allowing Bangle.js to send 'missed' health data

This commit is contained in:
Gordon Williams 2023-06-06 20:25:51 +01:00
parent 93e8996b52
commit e59375242e

View File

@ -569,6 +569,7 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
sample.setTimestamp((int) (GregorianCalendar.getInstance().getTimeInMillis() / 1000L));
int hrm = 0;
int steps = 0;
if (json.has("time")) sample.setTimestamp(json.getInt("time"));
if (json.has("hrm")) hrm = json.getInt("hrm");
if (json.has("stp")) steps = json.getInt("stp");
int activity = BangleJSSampleProvider.TYPE_ACTIVITY;