From 558f8b2cc099b3457f50021c16da1c5c3741fc77 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Fri, 5 Apr 2024 13:53:25 +0200 Subject: [PATCH] Slash lightning tweaks https://github.com/seerge/g-helper/issues/2381 --- app/AnimeMatrix/AniMatrixControl.cs | 4 +++- app/AnimeMatrix/SlashDevice.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/AnimeMatrix/AniMatrixControl.cs b/app/AnimeMatrix/AniMatrixControl.cs index 40c418e1..1d7cc6f8 100644 --- a/app/AnimeMatrix/AniMatrixControl.cs +++ b/app/AnimeMatrix/AniMatrixControl.cs @@ -61,9 +61,11 @@ namespace GHelper.AnimeMatrix public void SetLidMode(bool force = false) { - if (AppConfig.Is("matrix_lid") || force) + bool matrixLid = AppConfig.Is("matrix_lid"); + if (matrixLid || force) { Logger.WriteLine($"Matrix LidClosed: {lidClose}"); + if (deviceSlash is not null) deviceSlash.SetLidMode(matrixLid); SetDevice(true); } } diff --git a/app/AnimeMatrix/SlashDevice.cs b/app/AnimeMatrix/SlashDevice.cs index 4f4c0c38..f8b028f4 100644 --- a/app/AnimeMatrix/SlashDevice.cs +++ b/app/AnimeMatrix/SlashDevice.cs @@ -135,7 +135,7 @@ namespace GHelper.AnimeMatrix public void Set(Packet packet, string? log = null) { _usbProvider?.Set(packet.Data); - if (log is not null) Logger.WriteLine("Slash:" + BitConverter.ToString(packet.Data)); + if (log is not null) Logger.WriteLine($"{log}:" + BitConverter.ToString(packet.Data).Substring(0,48)); }