feat: add BatteryMonitor implementation with discovery, notification, and scheduling services
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>BatteryMonitor.Models</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace BatteryMonitor.Models;
|
||||
|
||||
public static class BatteryMonitorConsts
|
||||
{
|
||||
public const int DefaultBatteryThresholdPercent = 5;
|
||||
|
||||
public const string BatteryDeviceClass = "battery";
|
||||
|
||||
public const string SensorDomainPrefix = "sensor.";
|
||||
|
||||
public const string NotificationId = "battery_monitor_low_battery";
|
||||
|
||||
public const string NotificationTitle = "Low Battery Alert";
|
||||
|
||||
public const string PersistentNotificationDomain = "persistent_notification";
|
||||
|
||||
public const string PersistentNotificationCreateService = "create";
|
||||
|
||||
public const string PersistentNotificationDismissService = "dismiss";
|
||||
|
||||
public const string DailyCheckCron = "0 8 * * *";
|
||||
|
||||
public static readonly string[] ExcludedKeywords =
|
||||
[
|
||||
"iphone",
|
||||
"phone",
|
||||
"watch",
|
||||
"galaxy",
|
||||
"sm_s",
|
||||
"sm_a",
|
||||
"pixel",
|
||||
"oneplus",
|
||||
"ipad"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace BatteryMonitor.Models;
|
||||
|
||||
public sealed class BatterySensorInfo
|
||||
{
|
||||
public required string EntityId { get; init; }
|
||||
|
||||
public required string FriendlyName { get; init; }
|
||||
|
||||
public required double BatteryLevel { get; init; }
|
||||
}
|
||||
Reference in New Issue
Block a user