Files
HomeAssistant/NordPool.Models/NordPoolConsts.cs
T
gitea_admin 41ac93733e Clear Qodana findings in monitor runtime code
- Guard logger calls with IsEnabled so value-type arguments are not boxed
  when the level is disabled
- Make helper members static, narrow write-only properties to init or
  private get, and delete members no call site reaches
- Flatten nested conditionals and convert if/else chains into switch and
  ternary form
- Drop the unused *MonitorInit interfaces; NetDaemon instantiates the
  concrete app classes
- Drop the unused IConfiguration parameter from AddNordPool and
  AddPowerMonitor, and the unused IEntityManager.CreateEntitiesAsync
- Remove the ignored parameters of the boiler run-time tracker stub
- Pin the NordPool DTO price mapping explicitly so the getter use is
  visible to static analysis
- Fail Qodana on any finding and record the registration changes in
  AGENTS.md
2026-11-29 21:42:47 +02:00

51 lines
1.8 KiB
C#

namespace NordPool.Models;
public static class NordPoolConsts
{
public const string ConfigEntry = "01K9HYQE4Y0E7KC36JZV11MEXH";
/// <summary>
/// NordPool electricity market uses 15-minute trading intervals.
/// </summary>
public const int MinutesPerInterval = 15;
/// <summary>
/// Number of 15-minute intervals in one hour.
/// </summary>
public const int IntervalsPerHour = 4;
/// <summary>
/// Maximum number of 15-minute intervals in a single day (96 = 24h * 4).
/// </summary>
public const int MaxDailyIntervals = 96;
/// <summary>
/// Maximum expected price entries when today and tomorrow are both available
/// (96 intervals per day x 2 days). Used for logging a warning if exceeded.
/// </summary>
public const int MaxExpectedPriceEntries = 192;
public const string DeviceIdentifier = "nordpool";
public const string DeviceName = "NordPool";
public const string DeviceManufacturer = "HomeAssistant App Daemon";
/// <summary>
/// Home Assistant entity id for the Nord Pool current price sensor published by this integration.
/// </summary>
public const string CurrentPriceEntityId = "sensor.nordpool_current_price";
/// <summary>
/// Home Assistant entity id for the button that triggers a manual NordPool price fetch + entity update.
/// </summary>
public const string FetchPricesButtonEntityId = "button.nordpool_fetch_prices";
/// <summary>
/// Maximum number of retry attempts when fetching prices from the NordPool API.
/// </summary>
public const int MaxFetchRetryAttempts = 3;
/// <summary>
/// Base delay in seconds between retry attempts (used with exponential backoff).
/// </summary>
public const int RetryBaseDelaySeconds = 5;
}