feat: migrate boiler control implementation to BoilerMonitor namespace and add budget handling logic
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\HomeAssistant.Entities\HomeAssistant.Entities.csproj" />
|
||||
<ProjectReference Include="..\NordPool.Models\NordPool.Models.csproj" />
|
||||
<ProjectReference Include="..\PowerMonitor.Models\PowerMonitor.Models.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using NetDaemon.AppModel;
|
||||
using NetDaemon.Extensions.Scheduler;
|
||||
using NetDaemon.HassModel;
|
||||
using NetDaemon.HassModel.Entities;
|
||||
using NordPool.Models;
|
||||
using PowerMonitorManager.Interface;
|
||||
using PowerMonitorManager.Models;
|
||||
using PowerMonitorManager.Models.Consts;
|
||||
@@ -24,8 +25,6 @@ public sealed class PowerMonitorInit : IPowerMonitorInit
|
||||
private readonly IPowerCostCalculationService _costService;
|
||||
private readonly IPowerMonitorEntityService _entityService;
|
||||
|
||||
private const string NordPoolCurrentPriceEntityId = "sensor.nordpool_current_price";
|
||||
|
||||
private int _mainMeterConsecutiveFailures;
|
||||
private DateTime? _anomalyStartTime;
|
||||
|
||||
@@ -246,7 +245,7 @@ public sealed class PowerMonitorInit : IPowerMonitorInit
|
||||
|
||||
private double ReadNordPoolPrice()
|
||||
{
|
||||
var state = _haContext.GetState(NordPoolCurrentPriceEntityId);
|
||||
var state = _haContext.GetState(NordPoolConsts.CurrentPriceEntityId);
|
||||
if (state?.State is null || state.State == "unavailable" || state.State == "unknown")
|
||||
{
|
||||
_logger.LogDebug("NordPool price entity unavailable, using last known price");
|
||||
|
||||
Reference in New Issue
Block a user