This commit is contained in:
Serge
2024-04-18 10:55:00 +02:00
parent f13209f403
commit ad3d31cba4

View File

@@ -59,18 +59,6 @@ namespace GHelper.AnimeMatrix
if (deviceSlash is not null) SetSlash(wakeUp); if (deviceSlash is not null) SetSlash(wakeUp);
} }
public void SetLidMode(bool force = false)
{
bool matrixLid = AppConfig.Is("matrix_lid");
if (matrixLid || force)
{
Logger.WriteLine($"Matrix LidClosed: {lidClose}");
if (deviceSlash is not null) deviceSlash.SetLidMode(matrixLid);
SetDevice(true);
}
}
public void SetSlash(bool wakeUp = false) public void SetSlash(bool wakeUp = false)
{ {
if (deviceSlash is null) return; if (deviceSlash is null) return;
@@ -117,9 +105,27 @@ namespace GHelper.AnimeMatrix
}); });
} }
public void SetLidMode(bool force = false)
{
bool matrixLid = AppConfig.Is("matrix_lid");
if (deviceSlash is not null) deviceSlash.SetLidMode(matrixLid);
if (matrixLid || force)
{
Logger.WriteLine($"Matrix LidClosed: {lidClose}");
SetDevice(true);
}
}
public void SetBatteryAuto() public void SetBatteryAuto()
{ {
if (deviceSlash is not null) deviceSlash.SetBatterySaver(AppConfig.Is("matrix_auto")); if (deviceSlash is not null)
{
bool auto = AppConfig.Is("matrix_auto");
deviceSlash.SetBatterySaver(auto);
if (!auto) SetSlash();
}
if (deviceMatrix is not null) SetMatrix(); if (deviceMatrix is not null) SetMatrix();
} }