This commit is contained in:
Serge
2024-06-01 11:16:10 +02:00
parent 34161eee7c
commit bf4eae6081
3 changed files with 37 additions and 4 deletions

View File

@@ -1,5 +1,4 @@
using GHelper.Helpers;
using System.Diagnostics;
using System.Diagnostics;
namespace GHelper.Battery
{
@@ -37,6 +36,17 @@ namespace GHelper.Battery
if (limit < 0) limit = AppConfig.Get("charge_limit");
if (limit < 40 || limit > 100) return;
if (AppConfig.IsChargeLimit80())
{
limit = (limit <= 80) ? 80 : 100;
}
if (AppConfig.IsChargeLimit6080())
{
if (limit > 80) limit = 100;
else if (limit < 60) limit = 60;
}
Program.acpi.DeviceSet(AsusACPI.BatteryLimit, limit, "BatteryLimit");
AppConfig.Set("charge_limit", limit);