Skip to content

Commit 769e117

Browse files
committed
The issue of battery sensor disappearance when switching power modes has been fixed.
1 parent 79f5305 commit 769e117

1 file changed

Lines changed: 0 additions & 17 deletions

File tree

OpenHardwareMonitorLib/Hardware/Battery/Battery.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,6 @@ public Battery
139139

140140
public float? Voltage => _voltage.Value;
141141

142-
private void ActivateSensorIfValueNotNull(ISensor sensor)
143-
{
144-
if (sensor.Value != null)
145-
ActivateSensor(sensor);
146-
else
147-
DeactivateSensor(sensor);
148-
}
149-
150142
public override void Update()
151143
{
152144
Kernel32.BATTERY_WAIT_STATUS bws = default;
@@ -270,15 +262,6 @@ public override void Update()
270262
{
271263
_cycleCount.Value = null;
272264
}
273-
274-
ActivateSensorIfValueNotNull(_remainingCapacity);
275-
ActivateSensorIfValueNotNull(_chargeLevel);
276-
ActivateSensorIfValueNotNull(_voltage);
277-
ActivateSensorIfValueNotNull(_chargeDischargeCurrent);
278-
ActivateSensorIfValueNotNull(_chargeDischargeRate);
279-
ActivateSensorIfValueNotNull(_remainingTime);
280-
ActivateSensorIfValueNotNull(_temperature);
281-
ActivateSensorIfValueNotNull(_cycleCount);
282265
}
283266

284267
public override void Close()

0 commit comments

Comments
 (0)