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:
@@ -33,15 +33,19 @@ public sealed class BoilerConfigReader(IHaContext haContext, ILogger<BoilerConfi
|
||||
|
||||
if (!string.IsNullOrEmpty(readyByState) &&
|
||||
TimeSpan.TryParse(readyByState, CultureInfo.InvariantCulture, out var readyByTime))
|
||||
{
|
||||
deadline = DateTime.Today.Add(readyByTime);
|
||||
}
|
||||
|
||||
var skipPriceCapState = haContext.GetState(SkipPriceCapEntityId)?.State;
|
||||
var skipPriceCap = string.Equals(skipPriceCapState, SwitchOnState, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (logger.IsEnabled(LogLevel.Debug))
|
||||
{
|
||||
logger.LogDebug(
|
||||
"Boiler config: intervals={Intervals}, priceCap={Cap}, skipPriceCap={Skip}, deadline={Deadline}",
|
||||
intervalCount, priceCap, skipPriceCap, deadline);
|
||||
}
|
||||
|
||||
var config = new BoilerConfig
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user