From 4f6250ee1b86a9f45c5c29031d52e5b2ce166825 Mon Sep 17 00:00:00 2001 From: Mershl Date: Tue, 22 Feb 2022 17:36:16 +0100 Subject: [PATCH] Add handling for PENDING_CHARGE state Based on testing the state is reached when the hardware's charge limit blocks further charging. GNOME displays the state as "Not Charging" in the power options and the quick settings. The used icon is the default, non-charging battery. Currently batime shows PENDING_CHARGE as "Estimating..." which suggests a temporary state. Without external change the state is permanent (based on my testing). --- batime@martin.zurowietz.de/power.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/batime@martin.zurowietz.de/power.js b/batime@martin.zurowietz.de/power.js index 24fe9f9..a16140a 100644 --- a/batime@martin.zurowietz.de/power.js +++ b/batime@martin.zurowietz.de/power.js @@ -14,8 +14,10 @@ var Indicator = GObject.registerClass( seconds = this._proxy.TimeToFull; } else if (this._proxy.State === UPower.DeviceState.DISCHARGING) { seconds = this._proxy.TimeToEmpty; + } else if (this._proxy.State === UPower.DeviceState.PENDING_CHARGE) { + return ''; } else { - // state is one of PENDING_CHARGING, PENDING_DISCHARGING + // state is PENDING_DISCHARGE or UNKNOWN return _('Estimating…'); }