Bugfix: removing sensor didn't remove the aggregator.

Introduced in 58d79380cf.
This commit is contained in:
Dennis Guse
2023-11-16 06:53:19 +01:00
parent ce21fe3569
commit 5c7731bb1f
@@ -164,24 +164,24 @@ public final class SensorDataSet {
} }
private void set(@NonNull Aggregator<?, ?> type, @Nullable Aggregator<?, ?> sensorData) { private void set(@NonNull Aggregator<?, ?> type, @Nullable Aggregator<?, ?> sensorData) {
if (type instanceof AggregatorHeartRate hr) { if (type instanceof AggregatorHeartRate) {
heartRate = hr; heartRate = (AggregatorHeartRate) sensorData;
return; return;
} }
if (type instanceof AggregatorCyclingCadence cc) { if (type instanceof AggregatorCyclingCadence) {
cyclingCadence = cc; cyclingCadence = (AggregatorCyclingCadence) sensorData;
return; return;
} }
if (type instanceof AggregatorCyclingDistanceSpeed ds) { if (type instanceof AggregatorCyclingDistanceSpeed) {
cyclingDistanceSpeed = ds; cyclingDistanceSpeed = (AggregatorCyclingDistanceSpeed) sensorData;
return; return;
} }
if (type instanceof AggregatorCyclingPower cp) { if (type instanceof AggregatorCyclingPower) {
cyclingPower = cp; cyclingPower = (AggregatorCyclingPower) sensorData;
return; return;
} }
if (type instanceof AggregatorRunning rr) { if (type instanceof AggregatorRunning) {
runningDistanceSpeedCadence = rr; runningDistanceSpeedCadence = (AggregatorRunning) sensorData;
return; return;
} }