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).
This commit is contained in:
Mershl 2022-02-22 17:36:16 +01:00
parent 127806b4bb
commit 4f6250ee1b

View file

@ -14,8 +14,10 @@ var Indicator = GObject.registerClass(
seconds = this._proxy.TimeToFull; seconds = this._proxy.TimeToFull;
} else if (this._proxy.State === UPower.DeviceState.DISCHARGING) { } else if (this._proxy.State === UPower.DeviceState.DISCHARGING) {
seconds = this._proxy.TimeToEmpty; seconds = this._proxy.TimeToEmpty;
} else if (this._proxy.State === UPower.DeviceState.PENDING_CHARGE) {
return '';
} else { } else {
// state is one of PENDING_CHARGING, PENDING_DISCHARGING // state is PENDING_DISCHARGE or UNKNOWN
return _('Estimating…'); return _('Estimating…');
} }