diff --git a/FanControl/FanControllerSensors.cs b/FanControl/FanControllerSensors.cs index 30af3d4..a585255 100644 --- a/FanControl/FanControllerSensors.cs +++ b/FanControl/FanControllerSensors.cs @@ -12,7 +12,7 @@ namespace FanControl "APU", new FanSensor() { // TODO: Is this correct? - HardwareName = "AMD Custom APU 0405", + HardwareNames = { "AMD Custom APU 0405", "AMD Custom APU 0932" }, HardwareType = HardwareType.Cpu, SensorName = "Package", SensorType = SensorType.Power, @@ -48,7 +48,7 @@ namespace FanControl { "CPU", new FanSensor() { - HardwareName = "AMD Custom APU 0405", + HardwareNames = { "AMD Custom APU 0405", "AMD Custom APU 0932" }, HardwareType = HardwareType.Cpu, SensorName = "Core (Tctl/Tdie)", SensorType = SensorType.Temperature, @@ -84,11 +84,12 @@ namespace FanControl { "GPU", new FanSensor() { - HardwareName = "AMD Custom GPU 0405", + HardwareNames = { "AMD Custom GPU 0405", "AMD Custom GPU 0932" }, HardwareType = HardwareType.GpuAmd, SensorName = "GPU Core", SensorType = SensorType.Temperature, ValueDeadZone = 0.0f, + InvalidValue = 5.0f, AvgSamples = 20, Profiles = new Dictionary() { diff --git a/FanControl/FanSensor.cs b/FanControl/FanSensor.cs index 8683b20..cdf5f40 100644 --- a/FanControl/FanSensor.cs +++ b/FanControl/FanSensor.cs @@ -13,9 +13,11 @@ namespace FanControl public float ValueDeadZone { get; set; } public int AvgSamples { get; set; } = 5; + public float InvalidValue { get; set; } = 0.0f; public float? MaxValue { get; set; } internal string HardwareName { get; set; } = ""; + internal IList HardwareNames { get; set; } = new List(); internal HardwareType HardwareType { get; set; } internal string SensorName { get; set; } = ""; internal SensorType SensorType { get; set; } @@ -132,11 +134,29 @@ namespace FanControl CalculatedRPM = 0; } + private bool MatchesHardwareName(string sensorHardwareName) + { + if (HardwareNames.Count > 0) + { + if (HardwareNames.Any(hardwareName => sensorHardwareName.StartsWith(hardwareName))) + return true; + } + + // Empty string matches always + if (HardwareName.Length == 0) + return true; + + if (sensorHardwareName.StartsWith(HardwareName)) + return true; + + return false; + } + public bool Matches(ISensor sensor) { return sensor != null && sensor.Hardware.HardwareType == HardwareType && - sensor.Hardware.Name.StartsWith(HardwareName) && + MatchesHardwareName(sensor.Hardware.Name) && sensor.SensorType == SensorType && sensor.Name == SensorName; } @@ -156,7 +176,7 @@ namespace FanControl public bool Update(string name, float? newValue, FanMode mode) { - if (!newValue.HasValue || newValue <= 0.0) + if (!newValue.HasValue || newValue <= InvalidValue) return false; if (MaxValue.HasValue) @@ -210,8 +230,8 @@ namespace FanControl return ""; String value = ""; - - if (AllSamples.Count > 0) + + if (AllSamples.Count > 0) value += AllSamples.Last().ToString("F1") + Unit(); value += " (avg: " + Value.Value.ToString("F1") + Unit() + ")"; diff --git a/PerformanceOverlay/Sensors.cs b/PerformanceOverlay/Sensors.cs index 1f4ffc3..dc8916d 100644 --- a/PerformanceOverlay/Sensors.cs +++ b/PerformanceOverlay/Sensors.cs @@ -165,7 +165,7 @@ namespace PerformanceOverlay "CPU_%", new HardwareSensor() { HardwareType = HardwareType.Cpu, - HardwareName = "AMD Custom APU 0405", + HardwareNames = { "AMD Custom APU 0405", "AMD Custom APU 0932" }, SensorType = SensorType.Load, SensorName = "CPU Total", Format = "F0" @@ -175,7 +175,7 @@ namespace PerformanceOverlay "CPU_W", new HardwareSensor() { HardwareType = HardwareType.Cpu, - HardwareName = "AMD Custom APU 0405", + HardwareNames = { "AMD Custom APU 0405", "AMD Custom APU 0932" }, SensorType = SensorType.Power, SensorName = "Package", Format = "F1" @@ -185,7 +185,7 @@ namespace PerformanceOverlay "CPU_T", new HardwareSensor() { HardwareType = HardwareType.Cpu, - HardwareName = "AMD Custom APU 0405", + HardwareNames = { "AMD Custom APU 0405", "AMD Custom APU 0932" }, SensorType = SensorType.Temperature, SensorName = "Core (Tctl/Tdie)", Format = "F1", @@ -201,7 +201,7 @@ namespace PerformanceOverlay return new HardwareSensor() { HardwareType = HardwareType.Cpu, - HardwareName = "AMD Custom APU 0405", + HardwareNames = { "AMD Custom APU 0405", "AMD Custom APU 0932" }, SensorType = SensorType.Clock, SensorName = "Core #" + index.ToString(), Format = "F0", diff --git a/RELEASE.md b/RELEASE.md index b75bd51..62773c1 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -4,16 +4,11 @@ [**READ IF PLAYING ONLINE GAMES AND/OR GAMES THAT HAVE ANTI-CHEAT ENABLED**](https://steam-deck-tools.ayufan.dev/#anti-cheat-and-antivirus-software) -## SteamDeck OLED support - -- There's incorrect CPU temperature reading -- There's a lack of GPU frequency reading - ## #{GIT_TAG_NAME} ## 0.7.1 -- SteamDeck OLED: Support bios 107 +- SteamDeck OLED: Support Bios 107 with temperature readings ## 0.7.0