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
@@ -0,0 +1,8 @@
using BoilerMonitor.Models.Enums;
namespace BoilerMonitorManager.Interface;
public interface IBoilerControlService
{
BoilerAction DetermineAction(bool isNowCheap, bool waterReady, string? currentSwitchState, bool budgetExhausted, bool budgetOverride);
}
@@ -0,0 +1,14 @@
using BoilerMonitorManager.Models;
namespace BoilerMonitorManager.Interface;
public interface IBoilerMonitorEntityService
{
Task CreateEntitiesAsync(CancellationToken cancellationToken = default);
Task ResetEntitiesAsync(CancellationToken cancellationToken = default);
Task ResetTransientEntitiesAsync(CancellationToken cancellationToken = default);
Task UpdateEntitiesAsync(BoilerMonitorUpdateContext context, CancellationToken cancellationToken = default);
Task CleanupEntitiesAsync(CancellationToken cancellationToken = default);
Task SetStatusAsync(string status);
PersistedBoilerState? ReadPersistedState();
}
@@ -0,0 +1,7 @@
namespace BoilerMonitorManager.Interface;
public interface IBoilerMonitorInit
{
Task InitializeAsync();
Task CleanupEntitiesAsync(CancellationToken cancellationToken = default);
}
@@ -0,0 +1,11 @@
using BoilerMonitorManager.Models;
namespace BoilerMonitorManager.Interface;
public interface IBoilerRunTimeTracker
{
void RecordPollResult(bool isHeating, TimeSpan pollInterval);
RunTimeSnapshot GetSnapshot();
void Reset();
void RestoreFromSnapshot(TimeSpan accumulatedRunTime, int sessionCount);
}
@@ -0,0 +1,9 @@
namespace BoilerMonitorManager.Interface;
public interface IWaterReadyService
{
bool IsWaterReady(string? switchState, double? powerWatts, double heatingThresholdWatts);
bool IsInCooldown { get; }
void NotifyTurnedOn();
void ResetCooldown();
}