Skip to content

Commit 242078f

Browse files
authored
Merge pull request #217 from SebastianOehm/dev-2.3
[BUGFIX] 195: Ensure battery runtime (when unavailable) will not be used as shutdown trigger
2 parents c556b78 + b9cd3fc commit 242078f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

WinNUT_V2/WinNUT-Client/WinNUT.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,8 @@ Public Class WinNUT
641641
If .Batt_Charge = -1 AndAlso .Batt_Runtime = -1 Then
642642
LogFile.LogTracing("Battery properties unavailable, unable to validate shutdown conditions.", LogLvl.LOG_WARNING, Me)
643643
ElseIf Not ShutdownStatus Then
644-
If .Batt_Charge <= My.Settings.PW_BattChrgFloor Or
645-
.Batt_Runtime <= My.Settings.PW_RuntimeFloor Then
644+
If (.Batt_Charge <> -1 AndAlso .Batt_Charge <= My.Settings.PW_BattChrgFloor) Or
645+
(.Batt_Runtime <> -1 AndAlso .Batt_Runtime <= My.Settings.PW_RuntimeFloor) Then
646646
LogFile.LogTracing("UPS battery has dropped below stop condition limits.",
647647
LogLvl.LOG_NOTICE, Me, StrLog.Item(AppResxStr.STR_LOG_SHUT_START))
648648
Shutdown_Event()

0 commit comments

Comments
 (0)