Upower now also reports "pending-charge", fixes #303

This commit is contained in:
erpalma 2022-06-03 08:16:53 +02:00
parent 970001ec38
commit fb788f9005

View file

@ -316,7 +316,7 @@ def is_on_battery(config):
res = re.search(rb'state:\s+(.+)', out).group(1).decode().strip()
if res == 'discharging':
return True
elif res in ('fully-charged', 'charging'):
elif res in ('fully-charged', 'charging', 'pending-charge'):
return False
except:
pass