From ad3d31cba44b583f2505522ca31daa3418b3d5c5 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Thu, 18 Apr 2024 10:55:00 +0200 Subject: [PATCH] Slash lightning tweak https://github.com/seerge/g-helper/issues/2447 --- app/AnimeMatrix/AniMatrixControl.cs | 32 +++++++++++++++++------------ 1 file changed, 19 insertions(+), 13 deletions(-) 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(); }