feat: migrate boiler control implementation to BoilerMonitor namespace and add budget handling logic

This commit is contained in:
Marius
2026-03-24 15:29:59 +02:00
parent c4015277a3
commit 11c2574235
61 changed files with 3250 additions and 728 deletions
+28 -5
View File
@@ -1,13 +1,21 @@
using HomeAssistant.Models;
using HomeAssistant.Models;
using NetDaemon.Extensions.MqttEntityManager;
namespace NordPool.Models;
public class NordPoolEntity : EntityCreateModel
{
public string Domain { get; set; } // example: sensor
public string Identifier { get; set; } // example: name of the sensor
public string Name { get; set; } // friendly name for UI
private static readonly object DeviceBlock = new
{
identifiers = new[] { NordPoolConsts.DeviceIdentifier },
name = NordPoolConsts.DeviceName,
model = NordPoolConsts.DeviceName,
manufacturer = NordPoolConsts.DeviceManufacturer
};
public string Domain { get; set; }
public string Identifier { get; set; }
public string Name { get; set; }
public NordPoolEntity(string domain, string identifier, string name)
{
@@ -20,7 +28,22 @@ public class NordPoolEntity : EntityCreateModel
{
UniqueId = EntityId,
Name = Name
};
AdditionalConfig = new { device = DeviceBlock };
}
/// <summary>
/// Creates an AdditionalConfig that merges custom properties with the NordPool device block.
/// Use this when an entity needs extra config beyond the default device assignment.
/// </summary>
public static object CreateAdditionalConfig(object extraProperties)
{
var extras = extraProperties.GetType().GetProperties()
.ToDictionary(p => p.Name, p => p.GetValue(extraProperties));
extras["device"] = DeviceBlock;
return extras;
}
}