Only log remaining battery time if not connected to the grid.

This commit is contained in:
dbuechel 2019-09-10 11:57:15 +02:00
parent dda48396b3
commit ceba0e8a2f

View file

@ -43,7 +43,7 @@ namespace SafeExamBrowser.SystemComponents.PowerSupply
if (lastStatusLog < DateTime.Now.AddMinutes(-1))
{
logger.Debug($"Power grid is {(status.IsOnline ? "" : "not ")}connected, battery charge at {charge * 100}% ({status.BatteryTimeRemaining}).");
logger.Debug($"Power grid is {(status.IsOnline ? "" : "not ")}connected, battery charge at {charge * 100}%{(status.IsOnline ? "" : $" ({status.BatteryTimeRemaining})")}.");
lastStatusLog = DateTime.Now;
}