f919d6b25b
- Wrap using directives in `#region` blocks across the Battery, Boiler and NordPool sources and tests - Expand single-statement guards and loops into braced blocks - Realign wrapped method arguments, chained calls and continuations - Replace target-typed `new()` with explicit generic construction and empty string literals with `string.Empty` - Flatten the boiler config expression and reindent the remaining touched files
27 lines
867 B
C#
27 lines
867 B
C#
#region
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using NetDaemon.AppModel;
|
|
using NordPoolManager.Interface;
|
|
|
|
#endregion
|
|
|
|
namespace NordPoolManager;
|
|
|
|
public static class NordPoolServiceRegistration
|
|
{
|
|
public static IServiceCollection AddNordPool(this IServiceCollection services)
|
|
{
|
|
services
|
|
.AddNetDaemonApp<NordPoolInit>()
|
|
|
|
// Singleton is safe: NordPoolPriceService holds no IHaContext/generated
|
|
// entity dependency. The HA price fetch call lives in NordPoolInit.
|
|
.AddSingleton<INordPoolPriceService, NordPoolPriceService>()
|
|
.AddTransient<INordPoolEntityService, NordPoolEntityService>()
|
|
.AddTransient<ICheapestIntervalsFinder, CheapestIntervalsFinder>()
|
|
.AddScoped<INordPoolBoilerConfigProvider, NordPoolBoilerConfigProvider>();
|
|
|
|
return services;
|
|
}
|
|
} |