feat: add BatteryMonitor implementation with discovery, notification, and scheduling services
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
using BoilerMonitor.Models;
|
||||
using LightMonitor.Models;
|
||||
using NordPool.Models;
|
||||
using ShowerMonitor.Models;
|
||||
|
||||
namespace HomeAssistant.HistoryReplay.Configuration;
|
||||
|
||||
public static class ReplayEntityMap
|
||||
{
|
||||
public static IReadOnlyList<string> GetNordPoolEntities() =>
|
||||
[
|
||||
"sensor.nordpool_kwh_lt_eur_3_10_0",
|
||||
NordPoolConsts.CurrentPriceEntityId,
|
||||
BoilerMonitorConsts.BoilerDailyHoursEntityId,
|
||||
BoilerMonitorConsts.BoilerPriceCapEntityId,
|
||||
BoilerMonitorConsts.BoilerReadyByEntityId,
|
||||
BoilerMonitorConsts.SkipPriceCapEntityId
|
||||
];
|
||||
|
||||
public static IReadOnlyList<string> GetBoilerEntities(string boilerPowerEntityId, string boilerSwitchEntityId) =>
|
||||
[
|
||||
boilerPowerEntityId,
|
||||
boilerSwitchEntityId,
|
||||
"sensor.nordpool_cheapest_intervals",
|
||||
BoilerMonitorConsts.SkipPriceCapEntityId,
|
||||
BoilerMonitorConsts.BudgetOverrideEntityId,
|
||||
BoilerMonitorConsts.BoilerDailyHoursEntityId
|
||||
];
|
||||
|
||||
public static IReadOnlyList<string> GetShowerEntities(string bathroomHumidityEntityId, string mainHomeHumidityEntityId) =>
|
||||
[
|
||||
bathroomHumidityEntityId,
|
||||
mainHomeHumidityEntityId
|
||||
];
|
||||
|
||||
public static IReadOnlyList<string> GetPowerEntities(string mainMeterEntityId) =>
|
||||
[
|
||||
mainMeterEntityId,
|
||||
NordPoolConsts.CurrentPriceEntityId
|
||||
];
|
||||
|
||||
public static IReadOnlyList<string> GetLightEntities(string sunEntityId, string lightEntityId, string[] personEntityIds)
|
||||
{
|
||||
var entities = new List<string> { sunEntityId, lightEntityId };
|
||||
entities.AddRange(personEntityIds);
|
||||
return entities;
|
||||
}
|
||||
|
||||
public static IReadOnlyList<string> GetAllEntities(
|
||||
string boilerPowerEntityId,
|
||||
string boilerSwitchEntityId,
|
||||
string bathroomHumidityEntityId,
|
||||
string mainHomeHumidityEntityId,
|
||||
string mainMeterEntityId,
|
||||
string sunEntityId,
|
||||
string lightEntityId,
|
||||
string[] personEntityIds)
|
||||
{
|
||||
var all = new HashSet<string>();
|
||||
|
||||
foreach (var e in GetNordPoolEntities()) all.Add(e);
|
||||
foreach (var e in GetBoilerEntities(boilerPowerEntityId, boilerSwitchEntityId)) all.Add(e);
|
||||
foreach (var e in GetShowerEntities(bathroomHumidityEntityId, mainHomeHumidityEntityId)) all.Add(e);
|
||||
foreach (var e in GetPowerEntities(mainMeterEntityId)) all.Add(e);
|
||||
foreach (var e in GetLightEntities(sunEntityId, lightEntityId, personEntityIds)) all.Add(e);
|
||||
|
||||
return [.. all];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user