[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()
def determine_method(self):
try:
output = bumblebee.util.execute("sensors -u")
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
if self.parameter("path") != None:
self.use_sensors = False # use thermal zone
else:
# try to use output of sensors -u
try:
output = bumblebee.util.execute("sensors -u")
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):
output = bumblebee.util.execute("sensors -u")