diff --git a/CentralHub.Api/Controllers/MeasurementController.cs b/CentralHub.Api/Controllers/MeasurementController.cs index e55f7ab..1411a5e 100644 --- a/CentralHub.Api/Controllers/MeasurementController.cs +++ b/CentralHub.Api/Controllers/MeasurementController.cs @@ -89,29 +89,12 @@ public async Task GetFirstAggreg private static IReadOnlyList CreateMeasurements(IReadOnlyCollection aggregatedMeasurements) { - var recentAggregatedMeasurements = aggregatedMeasurements - .Where(am => am.EndTime > (DateTime.UtcNow - TimeSpan.FromDays(1))) - .ToImmutableArray(); - - int bluetoothCalibrationNumber; - int wifiCalibrationNumber; - if (recentAggregatedMeasurements.Any()) - { - bluetoothCalibrationNumber = recentAggregatedMeasurements.Min(am => am.BluetoothCount); - wifiCalibrationNumber = recentAggregatedMeasurements.Min(am => am.WifiCount); - } - else - { - bluetoothCalibrationNumber = 0; - wifiCalibrationNumber = 0; - } - return aggregatedMeasurements.Select(am => new AggregatedMeasurements( am.AggregatedMeasurementDtoId, am.StartTime, am.EndTime, - am.BluetoothCount - bluetoothCalibrationNumber, - am.WifiCount - wifiCalibrationNumber) + am.BluetoothCount, + am.WifiCount) ).ToImmutableArray(); } }