feat: migrate boiler control implementation to BoilerMonitor namespace and add budget handling logic
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user