feat: wire up PowerMonitor DI registration and complete integration
Made-with: Cursor
This commit is contained in:
@@ -4,7 +4,8 @@
|
|||||||
"Default": "Warning",
|
"Default": "Warning",
|
||||||
"Override": {
|
"Override": {
|
||||||
"System.Net.Http.HttpClient": "Warning",
|
"System.Net.Http.HttpClient": "Warning",
|
||||||
"NordPoolManager": "Information"
|
"NordPoolManager": "Information",
|
||||||
|
"PowerMonitorManager": "Information"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"WriteTo": [
|
"WriteTo": [
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ using NetDaemon.Extensions.Tts;
|
|||||||
using NetDaemon.Runtime;
|
using NetDaemon.Runtime;
|
||||||
using NordPoolManager;
|
using NordPoolManager;
|
||||||
using NordPoolManager.Interface;
|
using NordPoolManager.Interface;
|
||||||
|
using PowerMonitorManager;
|
||||||
|
using PowerMonitorManager.Interface;
|
||||||
|
using PowerMonitorManager.Models;
|
||||||
|
|
||||||
#pragma warning disable CA1812
|
#pragma warning disable CA1812
|
||||||
|
|
||||||
@@ -24,7 +27,7 @@ try
|
|||||||
.UseCustomLogging()
|
.UseCustomLogging()
|
||||||
.UseNetDaemonRuntime()
|
.UseNetDaemonRuntime()
|
||||||
.UseNetDaemonTextToSpeech()
|
.UseNetDaemonTextToSpeech()
|
||||||
.ConfigureServices((_, services) =>
|
.ConfigureServices((context, services) =>
|
||||||
services
|
services
|
||||||
.AddNetDaemonMqttEntityManagement()
|
.AddNetDaemonMqttEntityManagement()
|
||||||
.AddAppsFromAssembly(Assembly.GetExecutingAssembly())
|
.AddAppsFromAssembly(Assembly.GetExecutingAssembly())
|
||||||
@@ -44,6 +47,13 @@ try
|
|||||||
.AddTransient<INordPoolEntityService, NordPoolEntityService>()
|
.AddTransient<INordPoolEntityService, NordPoolEntityService>()
|
||||||
.AddSingleton<ICheapestIntervalsFinder, CheapestIntervalsFinder>()
|
.AddSingleton<ICheapestIntervalsFinder, CheapestIntervalsFinder>()
|
||||||
.AddSingleton<IBoilerControlService, BoilerControlService>()
|
.AddSingleton<IBoilerControlService, BoilerControlService>()
|
||||||
|
.Configure<PowerMonitorOptions>(
|
||||||
|
context.Configuration.GetSection(PowerMonitorOptions.SectionName))
|
||||||
|
.AddNetDaemonApp<PowerMonitorInit>()
|
||||||
|
.AddSingleton<IPowerSensorDiscoveryService, PowerSensorDiscoveryService>()
|
||||||
|
.AddSingleton<IOtherPowerCalculationService, OtherPowerCalculationService>()
|
||||||
|
.AddSingleton<IPowerCostCalculationService, PowerCostCalculationService>()
|
||||||
|
.AddTransient<IPowerMonitorEntityService, PowerMonitorEntityService>()
|
||||||
)
|
)
|
||||||
.Build()
|
.Build()
|
||||||
.RunAsync()
|
.RunAsync()
|
||||||
|
|||||||
Reference in New Issue
Block a user