feat: migrate boiler control implementation to BoilerMonitor namespace and add budget handling logic

This commit is contained in:
Marius
2026-03-24 15:29:59 +02:00
parent c4015277a3
commit 11c2574235
61 changed files with 3250 additions and 728 deletions
@@ -6,8 +6,6 @@ namespace NordPoolManager;
public class CheapestIntervalsFinder(ILogger<CheapestIntervalsFinder> logger) : ICheapestIntervalsFinder
{
private const string SwitchOnState = "on";
public IReadOnlyList<CheapestIntervalResult> FindCheapestIntervals(NordPoolPrice prices, int numberOfIntervals, double priceCap, DateTime deadline)
{
if (prices.Prices is not { Count: > 0 })
@@ -54,14 +52,4 @@ public class CheapestIntervalsFinder(ILogger<CheapestIntervalsFinder> logger) :
{
return cheapestIntervals.AsParallel().Any(interval => utcNow >= interval.Start && utcNow < interval.End);
}
public bool IsWaterReady(string? switchState, double? powerWatts)
{
if (switchState == null || powerWatts == null)
{
return false;
}
return string.Equals(switchState, SwitchOnState, StringComparison.OrdinalIgnoreCase) && powerWatts.Value < NordPoolConsts.WaterReadyPowerThresholdWatts;
}
}