diff --git a/NucuCar.Domain/Sensors/Bme680MeasurementData.cs b/NucuCar.Domain/Sensors/Bme680MeasurementData.cs deleted file mode 100644 index 02ce614..0000000 --- a/NucuCar.Domain/Sensors/Bme680MeasurementData.cs +++ /dev/null @@ -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; } - } -} \ No newline at end of file diff --git a/NucuCar.Sensors/EnvironmentSensor/Bme680Config.cs b/NucuCar.Sensors/Environment/Bme680Config.cs similarity index 80% rename from NucuCar.Sensors/EnvironmentSensor/Bme680Config.cs rename to NucuCar.Sensors/Environment/Bme680Config.cs index 30745ab..0105193 100644 --- a/NucuCar.Sensors/EnvironmentSensor/Bme680Config.cs +++ b/NucuCar.Sensors/Environment/Bme680Config.cs @@ -1,6 +1,6 @@ // ReSharper disable UnusedAutoPropertyAccessor.Global -namespace NucuCar.Sensors.EnvironmentSensor +namespace NucuCar.Sensors.Environment { public class Bme680Config { diff --git a/NucuCar.Sensors/EnvironmentSensor/Bme680GrpcService.cs b/NucuCar.Sensors/Environment/Bme680GrpcService.cs similarity index 96% rename from NucuCar.Sensors/EnvironmentSensor/Bme680GrpcService.cs rename to NucuCar.Sensors/Environment/Bme680GrpcService.cs index 429dfd0..f01b792 100644 --- a/NucuCar.Sensors/EnvironmentSensor/Bme680GrpcService.cs +++ b/NucuCar.Sensors/Environment/Bme680GrpcService.cs @@ -4,7 +4,7 @@ using Grpc.Core; using Microsoft.Extensions.Logging; using NucuCarSensorsProto; -namespace NucuCar.Sensors.EnvironmentSensor +namespace NucuCar.Sensors.Environment { /// /// EnvironmentSensor's gRPC service. diff --git a/NucuCar.Sensors/EnvironmentSensor/Bme680Sensor.cs b/NucuCar.Sensors/Environment/Bme680Sensor.cs similarity index 93% rename from NucuCar.Sensors/EnvironmentSensor/Bme680Sensor.cs rename to NucuCar.Sensors/Environment/Bme680Sensor.cs index 4b216ae..c5a68a0 100644 --- a/NucuCar.Sensors/EnvironmentSensor/Bme680Sensor.cs +++ b/NucuCar.Sensors/Environment/Bme680Sensor.cs @@ -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; } + } + /// /// 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 GetTelemetryData() diff --git a/NucuCar.Sensors/EnvironmentSensor/Bme680Worker.cs b/NucuCar.Sensors/Environment/Bme680Worker.cs similarity index 90% rename from NucuCar.Sensors/EnvironmentSensor/Bme680Worker.cs rename to NucuCar.Sensors/Environment/Bme680Worker.cs index 940cc25..1e643e6 100644 --- a/NucuCar.Sensors/EnvironmentSensor/Bme680Worker.cs +++ b/NucuCar.Sensors/Environment/Bme680Worker.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Logging; using NucuCar.Sensors.Telemetry; -namespace NucuCar.Sensors.EnvironmentSensor +namespace NucuCar.Sensors.Environment { public class Bme680Worker : SensorWorker { diff --git a/NucuCar.Sensors/GrpcStartup.cs b/NucuCar.Sensors/GrpcStartup.cs index d1a1ff3..be29db1 100644 --- a/NucuCar.Sensors/GrpcStartup.cs +++ b/NucuCar.Sensors/GrpcStartup.cs @@ -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(); + endpoints.MapGrpcService(); endpoints.MapGet("/", async context => diff --git a/NucuCar.Sensors/Program.cs b/NucuCar.Sensors/Program.cs index a1b2916..05ee9fd 100644 --- a/NucuCar.Sensors/Program.cs +++ b/NucuCar.Sensors/Program.cs @@ -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 diff --git a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680GrpcServiceTest.cs b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680GrpcServiceTest.cs index cb37010..c12557d 100644 --- a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680GrpcServiceTest.cs +++ b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680GrpcServiceTest.cs @@ -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; diff --git a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680WorkerTests.cs b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680WorkerTests.cs index 40e9441..41a69d0 100644 --- a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680WorkerTests.cs +++ b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680WorkerTests.cs @@ -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; diff --git a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/TestBme680Sensor.cs b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/TestBme680Sensor.cs index f00e40c..fa1bf60 100644 --- a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/TestBme680Sensor.cs +++ b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/TestBme680Sensor.cs @@ -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