Add braces to single-statement guards and refactor NordPool price fetching
- Expand inline guard, return and logger blocks across the monitor services, init classes and tests - Have INordPoolPriceService take a per-date fetch delegate and expose ParseAndAdjust, moving the HA fetch call into NordPoolInit so the service can be registered singleton - Record the NordPool and boiler service lifetimes in AGENTS.md - Drop the unused persisted-state argument from the boiler test data helper
This commit is contained in:
@@ -88,14 +88,16 @@ collections) must be registered **scoped or transient**, never singleton,
|
||||
or app load fails with:
|
||||
`Cannot resolve scoped service … from root provider`.
|
||||
|
||||
Verified-livable registrations (do not regress these to singleton):
|
||||
Verified-livable registrations (do not regress these lifetimes; re-check
|
||||
scoped dependencies if changing one):
|
||||
- `Boiler`: `IBoilerMonitorEntityService` transient,
|
||||
`IBoilerControlService`/`IBoilerRunTimeTracker`/`IWaterReadyService`
|
||||
singleton (no HA dep), `IBoilerConfigReader` scoped (registered directly
|
||||
in `program.cs`, the only monitor service outside its
|
||||
`*ServiceRegistration.cs`).
|
||||
- `NordPool`: `INordPoolEntityService` transient, `INordPoolPriceService`
|
||||
scoped, `INordPoolBoilerConfigProvider` scoped,
|
||||
singleton (pure state/math, no HA dep — HA fetch call lives in
|
||||
`NordPoolInit`), `INordPoolBoilerConfigProvider` scoped,
|
||||
`ICheapestIntervalsFinder` singleton (no HA dep).
|
||||
- `Power`: `IPowerMonitorEntityService` + `IPowerNotificationService`
|
||||
transient, `IPowerSensorDiscoveryService` scoped. `IOtherPowerCalculationService`
|
||||
|
||||
Reference in New Issue
Block a user