first commit

This commit is contained in:
Karmel0x
2023-08-26 11:56:51 +02:00
commit 584bcadd2a
23 changed files with 1504 additions and 0 deletions

45
AsusFanControl/Program.cs Normal file
View File

@@ -0,0 +1,45 @@
using System;
using AsusSystemAnalysis;
namespace AsusFanControl
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static int Main(string[] args)
{
if (args.Length < 1)
{
Console.WriteLine("Usage: AsusFanControl <fanSpeedPercent>");
return 1;
}
bool tryParse = int.TryParse(args[0], out int num);
if (!tryParse)
{
Console.WriteLine("Please enter a numeric value for fan speed.");
return 1;
}
if ((num != 0 && num < 40) || num > 99)
{
Console.WriteLine("Please enter a value for fan speed between 40 and 99 or 0 for turning off test mode.");
Console.WriteLine("If you want to skip these limits you need to change it in source code.");
return 1;
}
var asusControl = new AsusControl();
var fanSpeeds = asusControl.GetFanSpeeds();
Console.WriteLine($"Current fan speeds: {string.Join(" ", fanSpeeds)}");
asusControl.SetFansSpeed(num);
return 0;
}
}
}