Beispiel #1
0
        public async Task RecieveSensorDataAsync(SensorEntity <TKey> sensorEntity)
        {
            var client     = GetClient(sensorEntity.Client);
            var latestData = await probeService.GetLatestDataAsync(sensorEntity.Id);

            var data = client.GetProbeData(sensorEntity);

            if (data == null)
            {
                return;
            }


            if (IsModelChanged(latestData, data))
            {
                var entityModel = GetEntityModel(data, sensorEntity);
                await probeService.AddAsync(entityModel);
            }
        }
Beispiel #2
0
        public async Task <ProbeEntity <ObjectId> > SensorDataLatests(string sensorId)
        {
            var id = keyService.ParseKey(sensorId);

            return(await probeService.GetLatestDataAsync(id));
        }