mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Notify on Battery status update
This commit is contained in:
@@ -92,6 +92,7 @@ namespace GHelper.Peripherals.Mouse
|
|||||||
internal const int ASUS_MOUSE_PACKET_SIZE = 65;
|
internal const int ASUS_MOUSE_PACKET_SIZE = 65;
|
||||||
|
|
||||||
public event EventHandler? Disconnect;
|
public event EventHandler? Disconnect;
|
||||||
|
public event EventHandler? BatteryUpdated;
|
||||||
|
|
||||||
private readonly string path;
|
private readonly string path;
|
||||||
|
|
||||||
@@ -346,6 +347,11 @@ namespace GHelper.Peripherals.Mouse
|
|||||||
IsDeviceReady = Battery > 0;
|
IsDeviceReady = Battery > 0;
|
||||||
|
|
||||||
Logger.WriteLine(GetDisplayName() + ": Got Battery Percentage " + Battery + "% - Charging:" + Charging);
|
Logger.WriteLine(GetDisplayName() + ": Got Battery Percentage " + Battery + "% - Charging:" + Charging);
|
||||||
|
|
||||||
|
if (BatteryUpdated is not null)
|
||||||
|
{
|
||||||
|
BatteryUpdated(this, EventArgs.Empty);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasEnergySettings())
|
if (HasEnergySettings())
|
||||||
|
|||||||
Reference in New Issue
Block a user