bumblebee-status/bumblebee_status
Antoine Beaupré 16c4ce2ee6
handle missing battery case
I run the same bumblebee-status configuration on my laptop and my
workstation. On my laptop, the upower module works fine: it says "ac"
when plugged in, charging, all that stuff is great.

But on my workstation, it's completely broken: it thinks there's a
battery (which is a mistake: there is no battery at all, apart maybe
from the CMOS battery, but that's not covered by upower), and it
thinks it's discharged, which makes a very noisy warning in the bar.

Now maybe there's something wrong with dbus, Debian, the kernel,
Linux, or some thing else in the stack. All I know is that
`self.power.get_display_device()` returns something like a valid
dbus object here and from there it confuses the heck out of the
module.

So this just adds a function to check if the actual device we're
talking about is actually present, and bails earlier otherwise.

Before: battery logo and "0% 00:00m!", all marked as critical ("red")

After: "ac" with the plugged in logo, not marked critical ("black")
2022-06-20 11:34:12 -04:00
..
core [core/input] methods can be event callbacks 2022-03-04 09:35:43 +01:00
modules handle missing battery case 2022-06-20 11:34:12 -04:00
util Fix exception in location.py. 2022-02-14 15:36:24 +02:00
__init__.py [tests] Fix failing tests 2020-05-10 12:56:30 +02:00
_version.py [all] black code :) 2020-05-09 21:24:28 +02:00
discover.py [doc] update API docs 2020-05-10 13:25:13 +02:00