From 000fbe466f67f73e8c00c58b3a2bb4af247ab326 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Sat, 21 Sep 2024 12:38:25 +0200 Subject: [PATCH] Slash Lighting lid close tweak https://github.com/seerge/g-helper/discussions/3145 --- app/AnimeMatrix/AniMatrixControl.cs | 7 +++++-- app/AnimeMatrix/SlashDevice.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/AnimeMatrix/AniMatrixControl.cs b/app/AnimeMatrix/AniMatrixControl.cs index 3c897461..eef3714e 100644 --- a/app/AnimeMatrix/AniMatrixControl.cs +++ b/app/AnimeMatrix/AniMatrixControl.cs @@ -111,8 +111,6 @@ namespace GHelper.AnimeMatrix deviceSlash.SetEnabled(true); deviceSlash.Init(); - deviceSlash.SetLidMode(false); - switch ((SlashMode)running) { case SlashMode.Static: @@ -150,6 +148,11 @@ namespace GHelper.AnimeMatrix { bool matrixLid = AppConfig.Is("matrix_lid"); + if (deviceSlash is not null) + { + deviceSlash.SetLidMode(!matrixLid); + } + if (matrixLid || force) { Logger.WriteLine($"Matrix LidClosed: {lidClose}"); diff --git a/app/AnimeMatrix/SlashDevice.cs b/app/AnimeMatrix/SlashDevice.cs index 936e0dbc..0688f4f8 100644 --- a/app/AnimeMatrix/SlashDevice.cs +++ b/app/AnimeMatrix/SlashDevice.cs @@ -209,7 +209,7 @@ namespace GHelper.AnimeMatrix public void SetLidMode(bool status) { - Set(CreatePacket([0xD8, 0x00, 0x00, 0x02, 0xA5, status ? (byte)0x80 : (byte)0x00]), $"DisableLidClose {status}"); + Set(CreatePacket([0xD8, 0x00, 0x00, 0x02, 0xA5, status ? (byte)0x80 : (byte)0x00]), $"SlashLidCloseAnimation {status}"); } public void SetSleepActive(bool status)