mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-25 18:15:49 +01:00
Fix temperature preferences
This commit is contained in:
parent
f5b46b295b
commit
99dc218cd1
@ -51,7 +51,7 @@ import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.TemperatureSample;
|
||||
|
||||
public class TemperatureChartFragment extends AbstractChartFragment<TemperatureChartFragment.TemperatureChartsData> {
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(ActivitySleepChartFragment.class);
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(TemperatureChartFragment.class);
|
||||
|
||||
private LineChart mTemperatureChart;
|
||||
private int BACKGROUND_COLOR;
|
||||
|
@ -281,6 +281,31 @@ public class TestDeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
return supports(getTestDevice(), TestFeature.ACTIVITY_TRACKING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSleepMeasurement() {
|
||||
return supports(getTestDevice(), TestFeature.SLEEP_MEASUREMENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsStepCounter() {
|
||||
return supports(getTestDevice(), TestFeature.STEP_COUNTER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSpeedzones() {
|
||||
return supports(getTestDevice(), TestFeature.SPEEDZONES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTabs() {
|
||||
return supports(getTestDevice(), TestFeature.ACTIVITY_TABS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsTemperatureMeasurement() {
|
||||
return supports(getTestDevice(), TestFeature.TEMPERATURE_MEASUREMENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
return supports(getTestDevice(), TestFeature.ACTIVITY_TRACKS);
|
||||
|
@ -18,6 +18,7 @@ package nodomain.freeyourgadget.gadgetbridge.devices.test;
|
||||
|
||||
public enum TestFeature {
|
||||
ACTIVITY_DATA_FETCHING,
|
||||
ACTIVITY_TABS,
|
||||
ACTIVITY_TRACKING,
|
||||
ACTIVITY_TRACKS,
|
||||
ALARM_DESCRIPTION,
|
||||
@ -54,12 +55,16 @@ public enum TestFeature {
|
||||
REMINDERS,
|
||||
RGB_LED_COLOR,
|
||||
SCREENSHOTS,
|
||||
SLEEP_MEASUREMENT,
|
||||
SLEEP_RESPIRATORY_RATE,
|
||||
SMART_WAKEUP,
|
||||
SMART_WAKEUP_INTERVAL,
|
||||
SMART_WAKEUP_FORCED_SLOT,
|
||||
SPEEDZONES,
|
||||
SPO2,
|
||||
STEP_COUNTER,
|
||||
STRESS_MEASUREMENT,
|
||||
TEMPERATURE_MEASUREMENT,
|
||||
UNICODE_EMOJIS,
|
||||
WATCHFACE_MANAGEMENT,
|
||||
WEATHER,
|
||||
|
@ -19,7 +19,7 @@ package nodomain.freeyourgadget.gadgetbridge.devices.test.samples;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.TimeSampleProvider;
|
||||
@ -30,8 +30,19 @@ public class TestTemperatureSampleProvider implements TimeSampleProvider<Tempera
|
||||
@NonNull
|
||||
@Override
|
||||
public List<TemperatureSample> getAllSamples(final long timestampFrom, final long timestampTo) {
|
||||
// TODO fake samples
|
||||
return Collections.emptyList();
|
||||
final List<TemperatureSample> samples = new ArrayList<>();
|
||||
|
||||
int temp = TestDeviceRand.randInt(timestampFrom, 33, 40);
|
||||
|
||||
for (long ts = timestampFrom; ts < timestampTo; ts += 120 * 60 * 1000L) {
|
||||
if (TestDeviceRand.randBool(ts, 0.3f)) {
|
||||
samples.add(new TestTemperatureSample(ts, temp));
|
||||
}
|
||||
temp += TestDeviceRand.randInt(ts, 33 - temp, 40 - temp);
|
||||
break;
|
||||
}
|
||||
|
||||
return samples;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2994,6 +2994,7 @@
|
||||
<item>@string/stats_title</item>
|
||||
<item>@string/liveactivity_live_activity</item>
|
||||
<item>@string/pref_header_spo2</item>
|
||||
<item>@string/menuitem_temperature</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_charts_tabs_values">
|
||||
@ -3007,6 +3008,7 @@
|
||||
<item>@string/p_speed_zones</item>
|
||||
<item>@string/p_live_stats</item>
|
||||
<item>@string/p_spo2</item>
|
||||
<item>@string/p_temperature</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_charts_tabs_items_default">
|
||||
|
Loading…
Reference in New Issue
Block a user