feat: add BatteryMonitor implementation with discovery, notification, and scheduling services

This commit is contained in:
Marius
2026-04-01 10:55:33 +03:00
parent 11c2574235
commit 6e4d684359
114 changed files with 22820 additions and 527 deletions
@@ -0,0 +1,10 @@
using NetDaemon.HassModel;
using ShowerMonitor.Models.Enums;
namespace ShowerMonitorManager.Interface;
public interface IExhaustFanControlService
{
void Evaluate(ShowerState state, DateTimeOffset timestamp, IHaContext haContext);
void Reset(IHaContext haContext);
}
@@ -0,0 +1,8 @@
namespace ShowerMonitorManager.Interface;
public interface IHumidityRateCalculator
{
void RecordReading(double humidity, DateTimeOffset timestamp);
double GetRatePerMinute();
void Reset();
}
@@ -0,0 +1,15 @@
using ShowerMonitor.Models;
using ShowerMonitor.Models.Enums;
namespace ShowerMonitorManager.Interface;
public interface IShowerDetectionService
{
ShowerState CurrentState { get; }
ShowerSession? CurrentSession { get; }
ShowerSession? LastCompletedSession { get; }
int TodaySessionCount { get; }
ShowerState Evaluate(double bathroomHumidity, double mainHomeHumidity, DateTimeOffset timestamp);
void ResetDailyCounters();
}
@@ -0,0 +1,11 @@
using ShowerMonitorManager.Models;
namespace ShowerMonitorManager.Interface;
public interface IShowerMonitorEntityService
{
Task CreateEntitiesAsync(CancellationToken cancellationToken = default);
Task UpdateEntitiesAsync(ShowerMonitorUpdateContext context, CancellationToken cancellationToken = default);
Task ResetEntitiesAsync(CancellationToken cancellationToken = default);
Task CleanupEntitiesAsync(CancellationToken cancellationToken = default);
}
@@ -0,0 +1,7 @@
namespace ShowerMonitorManager.Interface;
public interface IShowerMonitorInit
{
Task InitializeAsync();
Task CleanupEntitiesAsync(CancellationToken cancellationToken = default);
}