mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Re-apply charge limit on every wake-up https://github.com/seerge/g-helper/issues/2785
This commit is contained in:
@@ -208,10 +208,10 @@ namespace GHelper
|
||||
|
||||
|
||||
|
||||
public static void SetAutoModes(bool powerChanged = false, bool init = false)
|
||||
public static bool SetAutoModes(bool powerChanged = false, bool init = false)
|
||||
{
|
||||
|
||||
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAuto) < 3000) return;
|
||||
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAuto) < 3000) return false;
|
||||
lastAuto = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
|
||||
isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
|
||||
@@ -240,6 +240,8 @@ namespace GHelper
|
||||
{
|
||||
settingsForm.AutoKeyboard();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
||||
|
||||
@@ -674,7 +674,7 @@ namespace GHelper
|
||||
break;
|
||||
case 1:
|
||||
Logger.WriteLine("Monitor Power On");
|
||||
Program.SetAutoModes();
|
||||
if (!Program.SetAutoModes()) BatteryControl.AutoBattery();
|
||||
break;
|
||||
case 2:
|
||||
Logger.WriteLine("Monitor Dimmed");
|
||||
|
||||
Reference in New Issue
Block a user