This commit is contained in:
2026-06-28 13:58:35 +03:00
parent 8f45028715
commit e6bf8258bb
114 changed files with 4365 additions and 874 deletions
+3 -7
View File
@@ -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)
{