[modules/sensors] Use thermal zone, if specified on commandline

fixes #298
This commit is contained in:
Tobias Witek 2018-09-24 18:15:04 +02:00
parent e80ae8b91e
commit 7af04b0556

View file

@ -32,13 +32,17 @@ class Module(bumblebee.engine.Module):
self.determine_method() self.determine_method()
def determine_method(self): def determine_method(self):
try: if self.parameter("path") != None:
output = bumblebee.util.execute("sensors -u") self.use_sensors = False # use thermal zone
self.use_sensors = True else:
log.debug("Sensors command available") # try to use output of sensors -u
except FileNotFoundError as e: try:
log.info("Sensors command not available, using /sys/class/thermal/thermal_zone*/") output = bumblebee.util.execute("sensors -u")
self.use_sensors = False self.use_sensors = True
log.debug("Sensors command available")
except FileNotFoundError as e:
log.info("Sensors command not available, using /sys/class/thermal/thermal_zone*/")
self.use_sensors = False
def _get_temp_from_sensors(self): def _get_temp_from_sensors(self):
output = bumblebee.util.execute("sensors -u") output = bumblebee.util.execute("sensors -u")