From 8e19dcb677166ed1cb95aed753f3a3f165ddd671 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 23 Jul 2023 18:29:34 +0200 Subject: [PATCH] Notify on Battery status update --- app/Peripherals/Mouse/AsusMouse.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index 03283d4d..5e5917c5 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -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())