feat: минорые изменения после тестирования

This commit is contained in:
2025-11-28 14:20:24 +03:00
parent 5ff0384def
commit d50557a581
12 changed files with 80 additions and 28 deletions
+2 -6
View File
@@ -7,23 +7,19 @@ namespace GSS2.Test;
public class Worker(
ILogger<Worker> logger,
AmineContentCalibrationContext calibrationContext,
LightsService lightsService,
TemperatureHumidityService temperatureHumidity
LightsService lightsService
) : BackgroundService
{
private readonly ILogger<Worker> _logger = logger;
private readonly AmineContentCalibrationContext _calibrationContext = calibrationContext;
private readonly LightsService _lightsService = lightsService;
private readonly TemperatureHumidityService _temperatureHumidity = temperatureHumidity;
protected override async Task ExecuteAsync(CancellationToken cancellationToken)
{
_ = _lightsService.Run(cancellationToken);
await _lightsService.SnowfallAsync(0.3, 1, Color.Aqua, cancellationToken);
_ = _lightsService.SnowfallAsync(0.3, 1, Color.Aqua, cancellationToken);
while (!cancellationToken.IsCancellationRequested)
{
var (temperature, humidity) = await _temperatureHumidity.MeasureAsync();
_logger.LogInformation("Temperature: {}, RelativeHumidity: {}", temperature, humidity);
await Task.Delay(5000);
}
}