From 7af04b055652020e40c5dba6ad47861e846bd79c Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Mon, 24 Sep 2018 18:15:04 +0200 Subject: [PATCH] [modules/sensors] Use thermal zone, if specified on commandline fixes #298 --- bumblebee/modules/sensors.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/bumblebee/modules/sensors.py b/bumblebee/modules/sensors.py index 1d483d2..2e9ef3a 100644 --- a/bumblebee/modules/sensors.py +++ b/bumblebee/modules/sensors.py @@ -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")