Skip to content

Commit

Permalink
Bugfix: removing sensor didn't remove the aggregator.
Browse files Browse the repository at this point in the history
Introduced in 58d7938.
  • Loading branch information
dennisguse committed Nov 16, 2023
1 parent ce21fe3 commit 5c7731b
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,24 +164,24 @@ public void reset() {
}

private void set(@NonNull Aggregator<?, ?> type, @Nullable Aggregator<?, ?> sensorData) {
if (type instanceof AggregatorHeartRate hr) {
heartRate = hr;
if (type instanceof AggregatorHeartRate) {
heartRate = (AggregatorHeartRate) sensorData;
return;
}
if (type instanceof AggregatorCyclingCadence cc) {
cyclingCadence = cc;
if (type instanceof AggregatorCyclingCadence) {
cyclingCadence = (AggregatorCyclingCadence) sensorData;
return;
}
if (type instanceof AggregatorCyclingDistanceSpeed ds) {
cyclingDistanceSpeed = ds;
if (type instanceof AggregatorCyclingDistanceSpeed) {
cyclingDistanceSpeed = (AggregatorCyclingDistanceSpeed) sensorData;
return;
}
if (type instanceof AggregatorCyclingPower cp) {
cyclingPower = cp;
if (type instanceof AggregatorCyclingPower) {
cyclingPower = (AggregatorCyclingPower) sensorData;
return;
}
if (type instanceof AggregatorRunning rr) {
runningDistanceSpeedCadence = rr;
if (type instanceof AggregatorRunning) {
runningDistanceSpeedCadence = (AggregatorRunning) sensorData;
return;
}

Expand Down

0 comments on commit 5c7731b

Please sign in to comment.