Apply code formatting cleanup across the monitor projects
- Wrap using directives in `#region` blocks across the Battery, Boiler and NordPool sources and tests - Expand single-statement guards and loops into braced blocks - Realign wrapped method arguments, chained calls and continuations - Replace target-typed `new()` with explicit generic construction and empty string literals with `string.Empty` - Flatten the boiler config expression and reindent the remaining touched files
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#region
|
||||
|
||||
using System.Reactive.Concurrency;
|
||||
using BatteryMonitor.Models;
|
||||
using BatteryMonitorManager.Interface;
|
||||
@@ -7,6 +9,8 @@ using Microsoft.Extensions.Options;
|
||||
using NetDaemon.AppModel;
|
||||
using NetDaemon.Extensions.Scheduler;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace BatteryMonitorManager;
|
||||
|
||||
[NetDaemonApp]
|
||||
@@ -58,12 +62,13 @@ public sealed class BatteryMonitorInit
|
||||
if (_logger.IsEnabled(LogLevel.Information))
|
||||
{
|
||||
_logger.LogInformation("BatteryMonitor initialized with threshold {Threshold}%",
|
||||
_options.BatteryThresholdPercent);
|
||||
_options.BatteryThresholdPercent);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error initializing BatteryMonitor");
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@@ -71,17 +76,17 @@ public sealed class BatteryMonitorInit
|
||||
private void ScheduleDailyCheck()
|
||||
{
|
||||
_scheduler.ScheduleCron(BatteryMonitorConsts.DailyCheckCron, () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation("Running scheduled daily battery check");
|
||||
CheckAndNotify();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error during scheduled battery check");
|
||||
}
|
||||
});
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation("Running scheduled daily battery check");
|
||||
CheckAndNotify();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error during scheduled battery check");
|
||||
}
|
||||
});
|
||||
|
||||
_logger.LogInformation("Scheduled daily battery check at 08:00");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user