feat: add PowerMonitor shared models, CostAccumulator, and entity types

Made-with: Cursor
This commit is contained in:
Marius
2026-03-17 12:46:34 +02:00
parent 6fd1af7e21
commit 47cccbfb81
6 changed files with 194 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
using HomeAssistant.Models;
using NetDaemon.Extensions.MqttEntityManager;
namespace PowerMonitor.Models;
public class PowerMonitorEntity : EntityCreateModel
{
public string Domain { get; set; }
public string Identifier { get; set; }
public string Name { get; set; }
public PowerMonitorEntity(string domain, string identifier, string name)
{
Domain = domain;
Identifier = identifier;
EntityId = $"{Domain}.{Identifier}";
Name = string.IsNullOrWhiteSpace(name) ? identifier : name;
Options = new EntityCreationOptions
{
UniqueId = EntityId,
Name = Name
};
}
}