Notify on Battery status update

This commit is contained in:
IceStormNG
2023-07-23 18:29:34 +02:00
parent e825612396
commit 8e19dcb677

View File

@@ -92,6 +92,7 @@ namespace GHelper.Peripherals.Mouse
internal const int ASUS_MOUSE_PACKET_SIZE = 65;
public event EventHandler? Disconnect;
public event EventHandler? BatteryUpdated;
private readonly string path;
@@ -346,6 +347,11 @@ namespace GHelper.Peripherals.Mouse
IsDeviceReady = Battery > 0;
Logger.WriteLine(GetDisplayName() + ": Got Battery Percentage " + Battery + "% - Charging:" + Charging);
if (BatteryUpdated is not null)
{
BatteryUpdated(this, EventArgs.Empty);
}
}
if (HasEnergySettings())