Ejemplo n.º 1
0
        private async Task UpdateTemperatureDataAsync(ITemperatureDeviceDataRepository repository, VegaDevice device)
        {
            var lastUpdateTime = await repository
                                 .GetUptimeAsync(device.Id, _cancellationToken)
                                 .ConfigureAwait(false);

            var vegaServerLoadedData = await communicator
                                       .GetTemperatureDeviceDatasAsync(device.Eui, device.Id, lastUpdateTime, _cancellationToken)
                                       .ConfigureAwait(false);

            await repository
            .AddAsync(vegaServerLoadedData, _cancellationToken)
            .ConfigureAwait(false);
        }