Update battery.py

I'm not a major programmer but would this fix the issue that we had? Instead of going straight to BAT0 it would go to any BAT that exists? Correct me if I'm wrong.
This commit is contained in:
Brandon - Lee Dodds 2017-06-18 09:40:47 +00:00 committed by GitHub
parent d69f13f0b4
commit ad330ad70e

View file

@ -26,7 +26,7 @@ class Module(bumblebee.engine.Module):
else: else:
self._batteries = [ "/sys/class/power_supply/{}".format(b) for b in self._batteries ] self._batteries = [ "/sys/class/power_supply/{}".format(b) for b in self._batteries ]
if len(self._batteries) == 0: if len(self._batteries) == 0:
self._batteries = [ "/sys/class/power_supply/BAT0" ] self._batteries = [ "/sys/class/power_supply/BAT*" ]
self.update(widgets) self.update(widgets)
def update(self, widgets): def update(self, widgets):