feat: migrate boiler control implementation to BoilerMonitor namespace and add budget handling logic
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using BoilerMonitor.Models;
|
||||
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>()
|
||||
.AddSingleton<IBoilerRunTimeTracker, BoilerRunTimeTracker>()
|
||||
.AddTransient<IBoilerMonitorEntityService, BoilerMonitorEntityService>()
|
||||
.AddSingleton<IWaterReadyService, WaterReadyService>()
|
||||
.AddSingleton(TimeProvider.System)
|
||||
.AddScoped<IBoilerConfigReader, BoilerConfigReader>();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user