Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Dec 21, 2024
1 parent 17121a2 commit d80c61d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/Mode/PowerNative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,17 @@ public static void SetPowerMode(string scheme)

}

public static void SetPowerPlan(string scheme = PLAN_BALANCED)
public static void SetPowerPlan(string scheme)
{
// Skipping power modes
if (overlays.Contains(scheme)) return;
if (GetActiveScheme().ToString() == scheme) return;

if (scheme is null) scheme = PLAN_BALANCED;
var activeScheme = GetActiveScheme().ToString();
if (activeScheme == scheme) return;

uint status = PowerSetActiveScheme(IntPtr.Zero, new Guid(scheme));
Logger.WriteLine("Power Plan " + scheme + ":" + (status == 0 ? "OK" : status));
Logger.WriteLine($"Power Plan {activeScheme} -> {scheme} :" + (status == 0 ? "OK" : status));
}

public static string GetDefaultPowerMode(int mode)
Expand Down

0 comments on commit d80c61d

Please sign in to comment.