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:
@@ -2,7 +2,7 @@ namespace PowerMonitorManager.Models;
|
||||
|
||||
public sealed class CostAccumulator(DateTime now)
|
||||
{
|
||||
private readonly Lock _lock = new();
|
||||
private readonly Lock _lock = new Lock();
|
||||
|
||||
private double _cost15Min;
|
||||
private double _cost1Hour;
|
||||
@@ -77,7 +77,10 @@ public sealed class CostAccumulator(DateTime now)
|
||||
_lastDailyReset = now;
|
||||
}
|
||||
|
||||
if (!IsNewMonthWindow(now, _lastMonthlyReset)) return;
|
||||
if (!IsNewMonthWindow(now, _lastMonthlyReset))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_previousMonthly = _costMonthly;
|
||||
_costMonthly = 0;
|
||||
@@ -88,6 +91,7 @@ public sealed class CostAccumulator(DateTime now)
|
||||
{
|
||||
var currentSlot = now.Minute / 15;
|
||||
var lastSlot = lastReset.Minute / 15;
|
||||
|
||||
return now.Date != lastReset.Date || now.Hour != lastReset.Hour || currentSlot != lastSlot;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#region
|
||||
|
||||
using PowerMonitorManager.Models.Consts;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace PowerMonitorManager.Models;
|
||||
|
||||
public sealed class PowerMonitorOptions
|
||||
|
||||
Reference in New Issue
Block a user