From 359575d00d6d3e0e50bba48886ffd99cc2aab380 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:44:41 +0200 Subject: [PATCH] Log cleanup --- app/AnimeMatrix/AniMatrixControl.cs | 2 ++ app/AnimeMatrix/SlashDevice.cs | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/AnimeMatrix/AniMatrixControl.cs b/app/AnimeMatrix/AniMatrixControl.cs index d1ca6496..6f03925f 100644 --- a/app/AnimeMatrix/AniMatrixControl.cs +++ b/app/AnimeMatrix/AniMatrixControl.cs @@ -114,6 +114,7 @@ namespace GHelper.AnimeMatrix switch ((SlashMode)running) { case SlashMode.Static: + Logger.WriteLine("Slash: Static"); var custom = AppConfig.GetString("slash_custom"); if (custom is not null && custom.Length > 0) { @@ -126,6 +127,7 @@ namespace GHelper.AnimeMatrix break; case SlashMode.BatteryLevel: // call tick to immediately update the pattern + Logger.WriteLine("Slash: Battery Level"); SlashTimer_start(); SlashTimer_tick(); break; diff --git a/app/AnimeMatrix/SlashDevice.cs b/app/AnimeMatrix/SlashDevice.cs index 1dfa1b7b..936e0dbc 100644 --- a/app/AnimeMatrix/SlashDevice.cs +++ b/app/AnimeMatrix/SlashDevice.cs @@ -182,17 +182,17 @@ namespace GHelper.AnimeMatrix public void SetBatteryPattern(int brightness) { - SetCustom(GetBatteryPattern(brightness, 100 * (GetBatteryChargePercentage() / AppConfig.Get("charge_limit", 100)))); + SetCustom(GetBatteryPattern(brightness, 100 * (GetBatteryChargePercentage() / AppConfig.Get("charge_limit", 100))), null); } - public void SetCustom(byte[] data) + public void SetCustom(byte[] data, string? log = "Static Data") { - Set(CreatePacket([0xD2, 0x02, 0x01, 0x08, 0xAC]), "Static"); - Set(CreatePacket([0xD3, 0x03, 0x01, 0x08, 0xAC, 0xFF, 0xFF, 0x01, 0x05, 0xFF, 0xFF]), "StaticSettings"); - Set(CreatePacket([0xD4, 0x00, 0x00, 0x01, 0xAC]), "StaticSave"); + Set(CreatePacket([0xD2, 0x02, 0x01, 0x08, 0xAC]), null); + Set(CreatePacket([0xD3, 0x03, 0x01, 0x08, 0xAC, 0xFF, 0xFF, 0x01, 0x05, 0xFF, 0xFF]), null); + Set(CreatePacket([0xD4, 0x00, 0x00, 0x01, 0xAC]), null); byte[] payload = new byte[] { 0xD3, 0x00, 0x00, 0x07 }; - Set(CreatePacket(payload.Concat(data.Take(7)).ToArray()), "Static Data"); + Set(CreatePacket(payload.Concat(data.Take(7)).ToArray()), log); } public void SetOptions(bool status, int brightness = 0, int interval = 0)