Apply code formatting cleanup across monitor projects
- Reindent appsettings.json and the MSBuild project files - Collapse single-statement guard blocks and tidy using and member order - Normalize XML doc indentation and file endings - Reorder BatteryMonitor test-data helpers and move the exclusion tests into their own region - Carry the same formatting through the boiler config, control, entity and test files
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
namespace BoilerMonitor.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Boiler scheduling configuration read from Home Assistant entity state.
|
||||
/// Boiler scheduling configuration read from Home Assistant entity state.
|
||||
/// </summary>
|
||||
public sealed class BoilerConfig
|
||||
{
|
||||
@@ -12,4 +12,4 @@ public sealed class BoilerConfig
|
||||
public required DateTime Deadline { get; init; }
|
||||
|
||||
public required bool SkipPriceCap { get; init; }
|
||||
}
|
||||
}
|
||||
@@ -8,11 +8,11 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\HomeAssistant.Models\HomeAssistant.Models.csproj" />
|
||||
<ProjectReference Include="..\HomeAssistant.Models\HomeAssistant.Models.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NetDaemon.Extensions.Mqtt" Version="26.43.1" />
|
||||
<PackageReference Include="NetDaemon.Extensions.Mqtt" Version="26.43.1"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -5,27 +5,21 @@ public static class BoilerMonitorConsts
|
||||
public const int DefaultPollIntervalSeconds = 30;
|
||||
|
||||
/// <summary>
|
||||
/// Power threshold in watts below which the boiler is considered to have finished heating (water ready).
|
||||
/// Also used as the default threshold above which the boiler is considered actively heating.
|
||||
/// Power threshold in watts below which the boiler is considered to have finished heating (water ready).
|
||||
/// Also used as the default threshold above which the boiler is considered actively heating.
|
||||
/// </summary>
|
||||
public const double DefaultHeatingPowerThresholdWatts = 5.0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of consecutive below-threshold power readings required before
|
||||
/// declaring water as ready. Prevents false positives from transient sensor glitches.
|
||||
/// At 30s poll interval, a value of 2 means 60s of confirmed low power.
|
||||
/// Number of consecutive below-threshold power readings required before
|
||||
/// declaring water as ready. Prevents false positives from transient sensor glitches.
|
||||
/// At 30s poll interval, a value of 2 means 60s of confirmed low power.
|
||||
/// </summary>
|
||||
public const int ConsecutiveReadingsRequired = 2;
|
||||
|
||||
public const string ShowerStateEntityId = "sensor.showermonitor_state";
|
||||
public const string ShowerActiveState = "Active";
|
||||
|
||||
/// <summary>
|
||||
/// Minimum interval between "hot water is ready" push notifications.
|
||||
/// Prevents notification spam when power readings fluctuate around the heating threshold.
|
||||
/// </summary>
|
||||
public static readonly TimeSpan WaterReadyNotificationCooldown = TimeSpan.FromHours(1);
|
||||
|
||||
public const int MinPollIntervalSeconds = 5;
|
||||
public const int MaxPollIntervalSeconds = 300;
|
||||
public const int PollIntervalStepSeconds = 5;
|
||||
@@ -52,8 +46,8 @@ public static class BoilerMonitorConsts
|
||||
public const string BudgetOverrideEntityId = "switch.boilermonitor_budget_override";
|
||||
|
||||
/// <summary>
|
||||
/// When on, the daemon may call the configured boiler switch per price/budget/water-ready logic.
|
||||
/// When off, monitoring continues but automatic turn_on/turn_off calls are suppressed (manual control).
|
||||
/// When on, the daemon may call the configured boiler switch per price/budget/water-ready logic.
|
||||
/// When off, monitoring continues but automatic turn_on/turn_off calls are suppressed (manual control).
|
||||
/// </summary>
|
||||
public const string AutoManagementEntityId = "switch.boilermonitor_auto_management";
|
||||
|
||||
@@ -73,4 +67,10 @@ public static class BoilerMonitorConsts
|
||||
public const string DeviceIdentifier = "boiler_monitor";
|
||||
public const string DeviceName = "Boiler Monitor";
|
||||
public const string DeviceManufacturer = "HomeAssistant App Daemon";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Minimum interval between "hot water is ready" push notifications.
|
||||
/// Prevents notification spam when power readings fluctuate around the heating threshold.
|
||||
/// </summary>
|
||||
public static readonly TimeSpan WaterReadyNotificationCooldown = TimeSpan.FromHours(1);
|
||||
}
|
||||
@@ -5,10 +5,6 @@ namespace BoilerMonitor.Models;
|
||||
|
||||
public class BoilerMonitorEntity : EntityCreateModel
|
||||
{
|
||||
private string Domain { get; }
|
||||
private string Identifier { get; }
|
||||
private string Name { get; }
|
||||
|
||||
public BoilerMonitorEntity(string domain, string identifier, string name)
|
||||
{
|
||||
Domain = domain;
|
||||
@@ -22,4 +18,8 @@ public class BoilerMonitorEntity : EntityCreateModel
|
||||
Name = Name
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private string Domain { get; }
|
||||
private string Identifier { get; }
|
||||
private string Name { get; }
|
||||
}
|
||||
@@ -5,4 +5,4 @@ public enum BoilerAction
|
||||
NoChange,
|
||||
TurnOn,
|
||||
TurnOff
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
namespace BoilerMonitor.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Reads the boiler scheduling configuration from Home Assistant entity state.
|
||||
/// Reads the boiler scheduling configuration from Home Assistant entity state.
|
||||
/// </summary>
|
||||
public interface IBoilerConfigReader
|
||||
{
|
||||
BoilerConfig ReadConfig();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user