diff --git a/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java b/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java index db389239d..a059a905f 100644 --- a/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java +++ b/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java @@ -1239,8 +1239,8 @@ public class GBDaoGenerator { private static Entity addWena3EnergySample(Schema schema, Entity user, Entity device) { Entity activitySample = addEntity(schema, "Wena3EnergySample"); - addCommonTimeSampleProperties("AbstractTimeSample", activitySample, user, device); - activitySample.addIntProperty("energy").notNull(); + addCommonTimeSampleProperties("AbstractBodyEnergySample", activitySample, user, device); + activitySample.addIntProperty("energy").notNull().codeBeforeGetter(OVERRIDE); return activitySample; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/wena3/SonyWena3Coordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/wena3/SonyWena3Coordinator.java index 38af0c762..309a2de65 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/wena3/SonyWena3Coordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/wena3/SonyWena3Coordinator.java @@ -22,7 +22,6 @@ import android.content.Context; import android.net.Uri; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; @@ -45,10 +44,9 @@ import nodomain.freeyourgadget.gadgetbridge.entities.Wena3HeartRateSampleDao; import nodomain.freeyourgadget.gadgetbridge.entities.Wena3StressSampleDao; import nodomain.freeyourgadget.gadgetbridge.entities.Wena3Vo2SampleDao; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; -import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate; import nodomain.freeyourgadget.gadgetbridge.model.AbstractNotificationPattern; import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample; -import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; +import nodomain.freeyourgadget.gadgetbridge.model.BodyEnergySample; import nodomain.freeyourgadget.gadgetbridge.model.HeartRateSample; import nodomain.freeyourgadget.gadgetbridge.model.StressSample; import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport; @@ -58,22 +56,11 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.sony.wena3.protocol. import nodomain.freeyourgadget.gadgetbridge.service.devices.sony.wena3.protocol.packets.notification.defines.VibrationKind; public class SonyWena3Coordinator extends AbstractBLEDeviceCoordinator { - @Nullable - @Override - public Class getPairingActivity() { - return null; - } - @Override public String getManufacturer() { return "Sony"; } - @Override - public boolean supportsAppsManagement(GBDevice device) { - return false; - } - @Override public Class getAppsManagementActivity() { return null; @@ -140,11 +127,6 @@ public class SonyWena3Coordinator extends AbstractBLEDeviceCoordinator { return true; } - @Override - public boolean supportsRealtimeData() { - return false; - } - @Override public boolean supportsActivityDataFetching() { return true; @@ -155,12 +137,6 @@ public class SonyWena3Coordinator extends AbstractBLEDeviceCoordinator { return true; } - - @Override - public boolean supportsAppReordering() { - return false; - } - @Override public boolean supportsStressMeasurement() { return true; @@ -171,11 +147,6 @@ public class SonyWena3Coordinator extends AbstractBLEDeviceCoordinator { return new SonyWena3StressSampleProvider(device, session); } - @Override - public boolean supportsSpo2(GBDevice device) { - return false; - } - @Override public boolean supportsHeartRateMeasurement(GBDevice device) { return true; @@ -186,6 +157,11 @@ public class SonyWena3Coordinator extends AbstractBLEDeviceCoordinator { return true; } + @Override + public boolean supportsBodyEnergy() { + return true; + } + @Override public SampleProvider getSampleProvider(GBDevice device, DaoSession session) { return new SonyWena3ActivitySampleProvider(device, session); @@ -196,17 +172,16 @@ public class SonyWena3Coordinator extends AbstractBLEDeviceCoordinator { return new SonyWena3HeartRateSampleProvider(device, session); } + @Override + public TimeSampleProvider getBodyEnergySampleProvider(GBDevice device, DaoSession session) { + return new SonyWena3EnergySampleProvider(device, session); + } @Override public InstallHandler findInstallHandler(Uri uri, Context context) { return null; } - @Override - public boolean supportsScreenshots(final GBDevice device) { - return false; - } - @Override public int getAlarmSlotCount(GBDevice device) { return SonyWena3Constants.ALARM_SLOTS; @@ -222,21 +197,11 @@ public class SonyWena3Coordinator extends AbstractBLEDeviceCoordinator { return true; } - @Override - public boolean supportsFindDevice() { - return false; - } - @Override public boolean supportsWeather() { return true; } - @Override - public boolean isExperimental() { - return false; - } - @Override public String[] getSupportedLanguageSettings(GBDevice device) { return new String[]{ @@ -259,7 +224,6 @@ public class SonyWena3Coordinator extends AbstractBLEDeviceCoordinator { }; } - public boolean supportsNotificationVibrationPatterns() { return true; }