Refactor services to use DI for IHaContext and TimeProvider
This commit is contained in:
@@ -20,7 +20,6 @@ public sealed class ShowerReplayRunner : IMonitorReplayRunner
|
||||
private readonly ReplayDataSeries _dataSeries;
|
||||
private readonly IShowerDetectionService _detectionService;
|
||||
private readonly IExhaustFanControlService _fanControlService;
|
||||
private readonly IHaContext _haContext;
|
||||
private readonly ILogger<ShowerReplayRunner> _logger;
|
||||
private readonly ReplayOptions _replayOptions;
|
||||
private readonly ShowerMonitorOptions _showerOptions;
|
||||
@@ -34,7 +33,6 @@ public sealed class ShowerReplayRunner : IMonitorReplayRunner
|
||||
ReplayDataSeries dataSeries,
|
||||
IShowerDetectionService detectionService,
|
||||
IExhaustFanControlService fanControlService,
|
||||
IHaContext haContext,
|
||||
ILogger<ShowerReplayRunner> logger,
|
||||
IOptions<ReplayOptions> replayOptions,
|
||||
IOptions<ShowerMonitorOptions> showerOptions)
|
||||
@@ -45,7 +43,6 @@ public sealed class ShowerReplayRunner : IMonitorReplayRunner
|
||||
_dataSeries = dataSeries;
|
||||
_detectionService = detectionService;
|
||||
_fanControlService = fanControlService;
|
||||
_haContext = haContext;
|
||||
_logger = logger;
|
||||
_replayOptions = replayOptions.Value;
|
||||
_showerOptions = showerOptions.Value;
|
||||
@@ -80,7 +77,7 @@ public sealed class ShowerReplayRunner : IMonitorReplayRunner
|
||||
|
||||
_dataSeries.AddPoint(MonitorName, "State", currentTime, (double)state);
|
||||
|
||||
_fanControlService.Evaluate(state, currentTime, _haContext);
|
||||
_fanControlService.Evaluate(state, currentTime);
|
||||
|
||||
if (state != previousState)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user