Skip to content

Commit

Permalink
Show battery pending charge/discharge states in Power Management
Browse files Browse the repository at this point in the history
  • Loading branch information
libf-de authored and mtwebster committed Apr 5, 2024
1 parent 9dcb820 commit 8214ed1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,14 @@ def set_device_battery_primary(self, device):
else:
details = UPowerGlib.Device.state_to_string(state)
else:
if state == UPowerGlib.DeviceState.CHARGING or state == UPowerGlib.DeviceState.PENDING_CHARGE:
if state == UPowerGlib.DeviceState.CHARGING:
details = _("Charging")
elif state == UPowerGlib.DeviceState.DISCHARGING or state == UPowerGlib.DeviceState.PENDING_DISCHARGE:
elif state == UPowerGlib.DeviceState.PENDING_CHARGE:
details = _("Not charging")
elif state == UPowerGlib.DeviceState.DISCHARGING:
details = _("Using battery power")
elif state == UPowerGlib.DeviceState.PENDING_DISCHARGE:
details = _("Not discharging")
elif state == UPowerGlib.DeviceState.FULLY_CHARGED:
details = _("Charging - fully charged")
elif state == UPowerGlib.DeviceState.EMPTY:
Expand Down

0 comments on commit 8214ed1

Please sign in to comment.