[modules/battery_all] Add logging if no battery is found
This commit is contained in:
parent
82154bb4a9
commit
603fc1ddc6
1 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@ Parameters:
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
|
import logging
|
||||||
|
|
||||||
import bumblebee.input
|
import bumblebee.input
|
||||||
import bumblebee.output
|
import bumblebee.output
|
||||||
|
@ -29,8 +30,8 @@ class Module(bumblebee.engine.Module):
|
||||||
for battery in os.listdir('/sys/class/power_supply/'):
|
for battery in os.listdir('/sys/class/power_supply/'):
|
||||||
if not any(i in battery for i in ['AC', 'hidpp']):
|
if not any(i in battery for i in ['AC', 'hidpp']):
|
||||||
self._batteries.append("/sys/class/power_supply/" + battery)
|
self._batteries.append("/sys/class/power_supply/" + battery)
|
||||||
except:
|
except as e:
|
||||||
pass
|
logging.exception("unable to detect batteries: {}".format(str(e)))
|
||||||
|
|
||||||
super(Module, self).__init__(engine, config, bumblebee.output.Widget(full_text=self.capacity))
|
super(Module, self).__init__(engine, config, bumblebee.output.Widget(full_text=self.capacity))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue