mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
21 lines
477 B
C#
21 lines
477 B
C#
namespace GHelper.Battery
|
|
{
|
|
internal class BatteryControl
|
|
{
|
|
|
|
public static void SetBatteryChargeLimit(int limit = -1)
|
|
{
|
|
|
|
if (limit < 0) limit = AppConfig.Get("charge_limit");
|
|
if (limit < 40 || limit > 100) return;
|
|
|
|
Program.settingsForm.VisualiseBattery(limit);
|
|
Program.acpi.DeviceSet(AsusACPI.BatteryLimit, limit, "BatteryLimit");
|
|
|
|
AppConfig.Set("charge_limit", limit);
|
|
|
|
}
|
|
|
|
}
|
|
}
|