diff --git a/app/AnimeMatrix/AniMatrixControl.cs b/app/AnimeMatrix/AniMatrixControl.cs index 1d7cc6f8..c97680a4 100644 --- a/app/AnimeMatrix/AniMatrixControl.cs +++ b/app/AnimeMatrix/AniMatrixControl.cs @@ -59,18 +59,6 @@ namespace GHelper.AnimeMatrix 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) { 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() { - 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(); }