Commit graph

7 commits

Author SHA1 Message Date
2e18d71284
battery: better support for pen battery and some formatting 2023-11-08 22:46:58 +01:00
Alex Kelly
c637392bd0 Correct battery modules handling of critical/warning states
The logic for the critical/warning handling on the battery modules was
applied BEFORE the discharging-<pct> logic.  This made it  possible for
those discharging states to get applied over a critical/warning and
allow a theme to override the critical/warning colors with a state of
"discharging-10", for example.

This change moves that logic after the discharging state, so that it
will always "win" if critical or warning states are set.

This also adds the "discharging" battery state to the critical/warning
check so the state will apply if the battery is not on AC power, but
would return normal otherwise.  Meaning, if the battery is "critical"
from a percentage check, but is plugged into power, the critical state
is removed.
2022-09-16 15:36:06 -04:00
Sam Tebbs
eabf167c1f Hide battery module if there are no batteries 2022-06-22 09:12:14 +01:00
tobi-wan-kenobi
caf2fea04b [modules/battery] gracefully handle "no batteries" case
if no batteries are found, assume the machine is running on AC.

fixes #636
2020-05-28 08:17:35 +02:00
tobi-wan-kenobi
bfe5d8f493 [module/battery] exception typo
see #628
2020-05-15 19:48:10 +02:00
tobi-wan-kenobi
92577e7d26 [all] black code :) 2020-05-09 21:24:28 +02:00
tobi-wan-kenobi
320827d577 [core] restructure to allow PIP packaging
OK - so I have to admit I *hate* the fact that PIP seems to require a
subdirectory named like the library.

But since the PIP package is something really nifty to have (thanks to
@tony again!!!), I updated the codebase to hopefully conform with what
PIP expects. Testruns so far look promising...
2020-05-09 21:22:00 +02:00
Renamed from modules/contrib/battery.py (Browse further)