[modules/sensors] Fix regex

fixes #308
This commit is contained in:
Tobias Witek 2018-11-13 18:23:53 +01:00
parent 2994d0efa0
commit bc569a11af

View file

@ -65,7 +65,7 @@ class Module(bumblebee.engine.Module):
output = bumblebee.util.execute("sensors -u")
if self._match_pattern:
temp_pattern = self.parameter("match", "temp1_input")
match = re.search(r"{}.+{}".format(self._match_pattern, temp_pattern), output.replace("\n", ""))
match = re.search(r"{}.+{}:\s*([\d.]+)$".format(self._match_pattern, temp_pattern), output.replace("\n", ""))
if match:
return int(float(match.group(1)))
else: