Glory Fit: switch to automatically generated sample provider

This commit is contained in:
Thomas Kuehne
2026-05-29 20:32:37 +00:00
parent caad9b0af4
commit 129ecb0c8c
4 changed files with 3 additions and 59 deletions
@@ -193,7 +193,7 @@ public class GBDaoGenerator {
addMoyoungBloodPressureSample(schema, user, device);
addMoyoungSleepStageSample(schema, user, device);
addMoyoungStressSample(schema, user, device);
addGloryFitStepsSample(schema, user, device);
sampleProvidersToGenerate.add(addGloryFitStepsSample(schema, user, device));
addKeephealthActivitySample(schema, user, device);
addKeephealthBloodPressureSample(schema, user, device);
addKeephealthTemperatureSample(schema, user, device);
@@ -18,6 +18,7 @@ package nodomain.freeyourgadget.gadgetbridge.devices.gloryfit
import nodomain.freeyourgadget.gadgetbridge.devices.GenericHeartRateSampleProvider
import nodomain.freeyourgadget.gadgetbridge.devices.GenericSleepStageSampleProvider
import nodomain.freeyourgadget.gadgetbridge.devices.GloryFitStepsSampleProvider
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession
import nodomain.freeyourgadget.gadgetbridge.entities.GenericActivitySample
@@ -1,57 +0,0 @@
/* Copyright (C) 2025 José Rebelo
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 <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.gloryfit;
import androidx.annotation.NonNull;
import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.Property;
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractTimeSampleProvider;
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
import nodomain.freeyourgadget.gadgetbridge.entities.GloryFitStepsSample;
import nodomain.freeyourgadget.gadgetbridge.entities.GloryFitStepsSampleDao;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
public class GloryFitStepsSampleProvider extends AbstractTimeSampleProvider<GloryFitStepsSample> {
public GloryFitStepsSampleProvider(final GBDevice device, final DaoSession session) {
super(device, session);
}
@NonNull
@Override
public AbstractDao<GloryFitStepsSample, ?> getSampleDao() {
return getSession().getGloryFitStepsSampleDao();
}
@NonNull
@Override
protected Property getTimestampSampleProperty() {
return GloryFitStepsSampleDao.Properties.Timestamp;
}
@NonNull
@Override
protected Property getDeviceIdentifierSampleProperty() {
return GloryFitStepsSampleDao.Properties.DeviceId;
}
@Override
public GloryFitStepsSample createSample() {
return new GloryFitStepsSample();
}
}
@@ -21,7 +21,7 @@ import nodomain.freeyourgadget.gadgetbridge.GBApplication
import nodomain.freeyourgadget.gadgetbridge.devices.GenericHeartRateSampleProvider
import nodomain.freeyourgadget.gadgetbridge.devices.GenericSleepStageSampleProvider
import nodomain.freeyourgadget.gadgetbridge.devices.GenericSpo2SampleProvider
import nodomain.freeyourgadget.gadgetbridge.devices.gloryfit.GloryFitStepsSampleProvider
import nodomain.freeyourgadget.gadgetbridge.devices.GloryFitStepsSampleProvider
import nodomain.freeyourgadget.gadgetbridge.entities.GenericHeartRateSample
import nodomain.freeyourgadget.gadgetbridge.entities.GenericSleepStageSample
import nodomain.freeyourgadget.gadgetbridge.entities.GenericSpo2Sample