Update
This commit is contained in:
@@ -76,7 +76,6 @@ public sealed class ShowerMonitorInit : IShowerMonitorInit
|
||||
}
|
||||
|
||||
await _entityService.CreateEntitiesAsync();
|
||||
await _entityService.ResetEntitiesAsync();
|
||||
|
||||
await Task.Delay(TimeSpan.FromSeconds(2));
|
||||
await PollAndUpdateAsync();
|
||||
@@ -103,8 +102,6 @@ public sealed class ShowerMonitorInit : IShowerMonitorInit
|
||||
var secondsUntilNext = _options.PollIntervalSeconds - currentSecondInInterval;
|
||||
var nextPollTime = now.Add(TimeSpan.FromSeconds(secondsUntilNext));
|
||||
|
||||
_logger.LogInformation("Scheduling ShowerMonitor polling every {Interval}s, first at {Time}", _options.PollIntervalSeconds, nextPollTime);
|
||||
|
||||
_scheduler.RunEvery(pollInterval, nextPollTime, async void () =>
|
||||
{
|
||||
try
|
||||
@@ -124,9 +121,8 @@ public sealed class ShowerMonitorInit : IShowerMonitorInit
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation("Midnight reset: clearing shower session counters");
|
||||
_logger.LogDebug("Midnight reset: clearing shower session counters");
|
||||
_detectionService.ResetDailyCounters();
|
||||
_ = _entityService.ResetEntitiesAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -141,7 +137,7 @@ public sealed class ShowerMonitorInit : IShowerMonitorInit
|
||||
cleanupButton.StateChanges()
|
||||
.Subscribe(_ =>
|
||||
{
|
||||
_logger.LogInformation("Cleanup button pressed, removing all ShowerMonitor entities");
|
||||
_logger.LogDebug("Cleanup button pressed, removing all ShowerMonitor entities");
|
||||
Task.Run(HandleCleanupAsync);
|
||||
});
|
||||
}
|
||||
@@ -154,7 +150,7 @@ public sealed class ShowerMonitorInit : IShowerMonitorInit
|
||||
_cleanedUp = true;
|
||||
_detectionService.ResetDailyCounters();
|
||||
_fanControlService.Reset(_haContext);
|
||||
_logger.LogInformation("ShowerMonitor cleanup complete");
|
||||
_logger.LogDebug("ShowerMonitor cleanup complete");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user