forked from amkovkov/GranuSightSoftware2
feat: минорые изменения после тестирования
This commit is contained in:
+2
-6
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user