mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-06 23:03:59 +00:00
Reset LibreHardware on system resume to fix battery bug
This commit is contained in:
parent
652a7277a1
commit
139200c1e5
4 changed files with 22 additions and 16 deletions
|
|
@ -61,7 +61,7 @@ namespace FanControl
|
|||
var fanMode = Enum.Parse(typeof(FanMode), Properties.Settings.Default.FanMode);
|
||||
setFanMode((FanMode)fanMode);
|
||||
}
|
||||
catch(System.ArgumentException)
|
||||
catch (System.ArgumentException)
|
||||
{
|
||||
setFanMode(FanMode.Default);
|
||||
}
|
||||
|
|
@ -73,18 +73,13 @@ namespace FanControl
|
|||
|
||||
Microsoft.Win32.SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
||||
}
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
base.OnClosed(e);
|
||||
|
||||
Microsoft.Win32.SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged;
|
||||
}
|
||||
|
||||
private void SystemEvents_PowerModeChanged(object sender, Microsoft.Win32.PowerModeChangedEventArgs e)
|
||||
{
|
||||
// Restore fan mode on resume
|
||||
if (e.Mode == Microsoft.Win32.PowerModes.Resume)
|
||||
{
|
||||
Instance.HardwareComputer.Reset();
|
||||
fanControl.SetMode(fanControl.Mode);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue