Refactor EnvironmentSensor namespace to Environment
This commit is contained in:
parent
2d4d0b494a
commit
80db516f2c
10 changed files with 19 additions and 21 deletions
|
@ -1,11 +0,0 @@
|
|||
namespace NucuCar.Domain.Sensors
|
||||
{
|
||||
// TODO Make generic, reuse nucucarsensor response or modify this.
|
||||
public class Bme680MeasurementData
|
||||
{
|
||||
public double Temperature { get; set; }
|
||||
public double Humidity { get; set; }
|
||||
public double Pressure { get; set; }
|
||||
public double VolatileOrganicCompounds { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
|
||||
namespace NucuCar.Sensors.EnvironmentSensor
|
||||
namespace NucuCar.Sensors.Environment
|
||||
{
|
||||
public class Bme680Config
|
||||
{
|
|
@ -4,7 +4,7 @@ using Grpc.Core;
|
|||
using Microsoft.Extensions.Logging;
|
||||
using NucuCarSensorsProto;
|
||||
|
||||
namespace NucuCar.Sensors.EnvironmentSensor
|
||||
namespace NucuCar.Sensors.Environment
|
||||
{
|
||||
/// <summary>
|
||||
/// EnvironmentSensor's gRPC service.
|
|
@ -10,8 +10,16 @@ using Newtonsoft.Json;
|
|||
using NucuCar.Domain.Sensors;
|
||||
using NucuCarSensorsProto;
|
||||
|
||||
namespace NucuCar.Sensors.EnvironmentSensor
|
||||
namespace NucuCar.Sensors.Environment
|
||||
{
|
||||
internal class Bme680MeasurementData
|
||||
{
|
||||
public double Temperature { get; set; }
|
||||
public double Humidity { get; set; }
|
||||
public double Pressure { get; set; }
|
||||
public double VolatileOrganicCompounds { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Abstraction for the BME680 sensor.
|
||||
/// See: https://www.bosch-sensortec.com/bst/products/all_products/bme680
|
||||
|
@ -120,7 +128,7 @@ namespace NucuCar.Sensors.EnvironmentSensor
|
|||
|
||||
public override string GetIdentifier()
|
||||
{
|
||||
return nameof(EnvironmentSensor);
|
||||
return "Bme680-Sensor";
|
||||
}
|
||||
|
||||
public override Dictionary<string, object> GetTelemetryData()
|
|
@ -1,7 +1,7 @@
|
|||
using Microsoft.Extensions.Logging;
|
||||
using NucuCar.Sensors.Telemetry;
|
||||
|
||||
namespace NucuCar.Sensors.EnvironmentSensor
|
||||
namespace NucuCar.Sensors.Environment
|
||||
{
|
||||
public class Bme680Worker : SensorWorker
|
||||
{
|
|
@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Hosting;
|
|||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using NucuCar.Sensors.Environment;
|
||||
|
||||
namespace NucuCar.Sensors
|
||||
{
|
||||
|
@ -29,7 +30,7 @@ namespace NucuCar.Sensors
|
|||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
// Add the gRPC services here.
|
||||
endpoints.MapGrpcService<EnvironmentSensor.Bme680GrpcService>();
|
||||
endpoints.MapGrpcService<Bme680GrpcService>();
|
||||
|
||||
endpoints.MapGet("/",
|
||||
async context =>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using NucuCar.Sensors.EnvironmentSensor;
|
||||
using NucuCar.Sensors.Environment;
|
||||
using NucuCar.Sensors.Telemetry;
|
||||
|
||||
namespace NucuCar.Sensors
|
||||
|
|
|
@ -2,7 +2,7 @@ using Microsoft.Extensions.Logging;
|
|||
using Moq;
|
||||
using NucuCar.Domain.Sensors;
|
||||
using NucuCar.Sensors;
|
||||
using NucuCar.Sensors.EnvironmentSensor;
|
||||
using NucuCar.Sensors.Environment;
|
||||
using NucuCarSensorsProto;
|
||||
using Xunit;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ using Microsoft.Extensions.Logging;
|
|||
using Microsoft.Extensions.Options;
|
||||
using Moq;
|
||||
using NucuCar.Sensors;
|
||||
using NucuCar.Sensors.EnvironmentSensor;
|
||||
using NucuCar.Sensors.Environment;
|
||||
using NucuCar.Sensors.Telemetry;
|
||||
using NucuCarSensorsProto;
|
||||
using Xunit;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using System.Threading.Tasks;
|
||||
using NucuCar.Sensors.EnvironmentSensor;
|
||||
using NucuCar.Sensors.Environment;
|
||||
using NucuCarSensorsProto;
|
||||
|
||||
namespace NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor.Tests
|
||||
|
|
Loading…
Reference in a new issue