Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Feb 12, 2024
1 parent ab44dbf commit f326fa9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
9 changes: 4 additions & 5 deletions app/AnimeMatrix/AniMatrixControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Timers;
using static GHelper.AnimeMatrix.BuiltInAnimation;

namespace GHelper.AnimeMatrix
{
Expand Down Expand Up @@ -36,7 +35,7 @@ public AniMatrixControl(SettingsForm settingsForm)

try
{
if (AppConfig.ContainsModel("GA403") || AppConfig.ContainsModel("GU605"))
if (AppConfig.IsSlash())
deviceSlash = new SlashDevice();
else
deviceMatrix = new AnimeMatrixDevice();
Expand Down Expand Up @@ -165,9 +164,9 @@ public void SetMatrix(bool wakeUp = false)
private void SetBuiltIn(int running)
{
BuiltInAnimation animation = new BuiltInAnimation(
(Running)running,
Sleeping.Starfield,
Shutdown.SeeYa,
(BuiltInAnimation.Running)running,
BuiltInAnimation.Sleeping.Starfield,
BuiltInAnimation.Shutdown.SeeYa,
BuiltInAnimation.Startup.StaticEmergence
);
deviceMatrix.SetBuiltInAnimation(true, animation);
Expand Down
8 changes: 4 additions & 4 deletions app/AnimeMatrix/SlashDevice.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using GHelper.AnimeMatrix.Communication;
using GHelper.Mode;
using System.Text;

namespace GHelper.AnimeMatrix
Expand Down Expand Up @@ -38,10 +37,10 @@ public class SlashDevice : Device
{ SlashMode.Bounce, "Bounce"},
{ SlashMode.Slash, "Slash"},
{ SlashMode.Loading, "Loading"},

{ SlashMode.BitStream, "Bit Stream"},
{ SlashMode.Transmission, "Transmission"},

{ SlashMode.Flow, "Flow"},
{ SlashMode.Flux, "Flux"},
{ SlashMode.Phantom, "Phantom"},
Expand Down Expand Up @@ -106,7 +105,8 @@ public void SetMode(SlashMode mode)
try
{
modeByte = modeCodes[mode];
} catch (Exception)
}
catch (Exception)
{
modeByte = 0x00;
}
Expand Down
9 changes: 7 additions & 2 deletions app/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static string GetModel()
}
}

if (_model.Contains("GA402")) _model = "ROG Zephyrus G14 GA403UI"; // Debug Purposes
//if (_model.Contains("GA402RK")) _model = "ROG Zephyrus G14 GA403UI"; // Debug Purposes

return _model;

Check warning on line 106 in app/AppConfig.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.
}
Expand Down Expand Up @@ -379,9 +379,14 @@ public static bool IsSingleColor()
return ContainsModel("GA401") || ContainsModel("FX517Z") || ContainsModel("FX516P") || ContainsModel("X13") || IsARCNM() || ContainsModel("GA502IU");
}

public static bool IsSlash()
{
return ContainsModel("GA403") || ContainsModel("GU605");
}

public static bool IsInputBacklight()
{
return ContainsModel("GA503") || ContainsModel("GA403");
return ContainsModel("GA503") || IsSlash();
}

public static bool IsStrix()
Expand Down
5 changes: 4 additions & 1 deletion app/USB/Aura.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,10 @@ public static void ApplyBrightness(int brightness, string log = "Backlight", boo
if (delay) await Task.Delay(TimeSpan.FromSeconds(1));
if (isACPI) Program.acpi.TUFKeyboardBrightness(brightness);

AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xBA, 0xC5, 0xC4, (byte)brightness }, log);
if (AppConfig.IsInputBacklight())
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xBA, 0xC5, 0xC4, (byte)brightness }, log);
else
AsusHid.Write(new byte[] { AsusHid.AURA_ID, 0xBA, 0xC5, 0xC4, (byte)brightness }, log);

if (AppConfig.IsAlly()) ApplyAura();

Expand Down

0 comments on commit f326fa9

Please sign in to comment.