Files
HomeAssistant/BoilerMonitor.Manager/BoilerMonitorServiceRegistration.cs
T
gitea_admin f0bbd4f10b Enable PowerMonitor limit enforcement and prune unused boiler/replay code
PowerMonitor now ships enabled with power-limit enforcement settings: watt limit, recovery and cooldown windows, and switch-off plus pause/restore entity lists.

Remove the unused BoilerRunTimeTracker, its DI registration and tests, the StatusCleanedUp constant, and the boiler replay runner; simplify BoilerConfigReader, control-service logging and entity parsing. Switch CostAccumulator to System.Threading.Lock, update the Shower exhaust fan service and tests, drop the legacy HistoryReplay/McpServer sources and reporting tooling, and expand AGENTS.md with the current project wiring and DI notes.
2026-11-29 13:58:08 +02:00

31 lines
976 B
C#

using BoilerMonitorManager.Interface;
using BoilerMonitorManager.Models;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using NetDaemon.AppModel;
namespace BoilerMonitorManager;
public static class BoilerMonitorServiceRegistration
{
public static IServiceCollection AddBoilerMonitor(this IServiceCollection services, IConfiguration configuration)
{
var options = configuration
.GetSection(BoilerMonitorOptions.SectionName)
.Get<BoilerMonitorOptions>() ?? new BoilerMonitorOptions();
if (!options.Enabled)
{
return services;
}
services
.AddNetDaemonApp<BoilerMonitorInit>()
.AddSingleton<IBoilerControlService, BoilerControlService>()
.AddTransient<IBoilerMonitorEntityService, BoilerMonitorEntityService>()
.AddSingleton<IWaterReadyService, WaterReadyService>();
return services;
}
}