mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Log cleanup
This commit is contained in:
@@ -114,6 +114,7 @@ namespace GHelper.AnimeMatrix
|
|||||||
switch ((SlashMode)running)
|
switch ((SlashMode)running)
|
||||||
{
|
{
|
||||||
case SlashMode.Static:
|
case SlashMode.Static:
|
||||||
|
Logger.WriteLine("Slash: Static");
|
||||||
var custom = AppConfig.GetString("slash_custom");
|
var custom = AppConfig.GetString("slash_custom");
|
||||||
if (custom is not null && custom.Length > 0)
|
if (custom is not null && custom.Length > 0)
|
||||||
{
|
{
|
||||||
@@ -126,6 +127,7 @@ namespace GHelper.AnimeMatrix
|
|||||||
break;
|
break;
|
||||||
case SlashMode.BatteryLevel:
|
case SlashMode.BatteryLevel:
|
||||||
// call tick to immediately update the pattern
|
// call tick to immediately update the pattern
|
||||||
|
Logger.WriteLine("Slash: Battery Level");
|
||||||
SlashTimer_start();
|
SlashTimer_start();
|
||||||
SlashTimer_tick();
|
SlashTimer_tick();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -182,17 +182,17 @@ namespace GHelper.AnimeMatrix
|
|||||||
|
|
||||||
public void SetBatteryPattern(int brightness)
|
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([0xD2, 0x02, 0x01, 0x08, 0xAC]), null);
|
||||||
Set(CreatePacket([0xD3, 0x03, 0x01, 0x08, 0xAC, 0xFF, 0xFF, 0x01, 0x05, 0xFF, 0xFF]), "StaticSettings");
|
Set(CreatePacket([0xD3, 0x03, 0x01, 0x08, 0xAC, 0xFF, 0xFF, 0x01, 0x05, 0xFF, 0xFF]), null);
|
||||||
Set(CreatePacket([0xD4, 0x00, 0x00, 0x01, 0xAC]), "StaticSave");
|
Set(CreatePacket([0xD4, 0x00, 0x00, 0x01, 0xAC]), null);
|
||||||
|
|
||||||
byte[] payload = new byte[] { 0xD3, 0x00, 0x00, 0x07 };
|
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)
|
public void SetOptions(bool status, int brightness = 0, int interval = 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user