if properties["battery.rechargeable.is_charging"]: state = "charging"
elif properties["battery.rechargeable.is_discharging"]: state = "discharging"
elif not properties["battery.rechargeable.is_discharging"] \ and not properties["battery.rechargeable.is_charging"]:
if current == 0: state = "empty" else: state = "charged"
If battery reports both charging and discharging as false, then we current level and if it is zero, it is empty, otherwise we consider it as fully charged.
It may be that your laptop does not consistently report charging=true and this case powermanager wrongly assumes the battery is fully charged.
I think this is caused by this assumption:
if properties[ "battery. rechargeable. is_charging" ]:
state = "charging" "battery. rechargeable. is_discharging" ]:
state = "discharging" "battery. rechargeable. is_discharging" ] \
and not properties[ "battery. rechargeable. is_charging" ]:
state = "empty"
else:
state = "charged"
elif properties[
elif not properties[
if current == 0:
If battery reports both charging and discharging as false, then we current level and if it is zero, it is empty, otherwise we consider it as fully charged.
It may be that your laptop does not consistently report charging=true and this case powermanager wrongly assumes the battery is fully charged.