Skip to content

Commit

Permalink
The issue of battery sensor disappearance when switching power modes …
Browse files Browse the repository at this point in the history
…has been fixed.
  • Loading branch information
sergiye committed Nov 29, 2024
1 parent 79f5305 commit 769e117
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions OpenHardwareMonitorLib/Hardware/Battery/Battery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,6 @@ public Battery

public float? Voltage => _voltage.Value;

private void ActivateSensorIfValueNotNull(ISensor sensor)
{
if (sensor.Value != null)
ActivateSensor(sensor);
else
DeactivateSensor(sensor);
}

public override void Update()
{
Kernel32.BATTERY_WAIT_STATUS bws = default;
Expand Down Expand Up @@ -270,15 +262,6 @@ public override void Update()
{
_cycleCount.Value = null;
}

ActivateSensorIfValueNotNull(_remainingCapacity);
ActivateSensorIfValueNotNull(_chargeLevel);
ActivateSensorIfValueNotNull(_voltage);
ActivateSensorIfValueNotNull(_chargeDischargeCurrent);
ActivateSensorIfValueNotNull(_chargeDischargeRate);
ActivateSensorIfValueNotNull(_remainingTime);
ActivateSensorIfValueNotNull(_temperature);
ActivateSensorIfValueNotNull(_cycleCount);
}

public override void Close()
Expand Down

0 comments on commit 769e117

Please sign in to comment.