[modules/sensors] do not truncate temperature

use strip() instead of a sub-list to get the value for the temperature.

fixes #787
This commit is contained in:
tobi-wan-kenobi 2021-05-11 11:23:06 +02:00
parent 7f03c9ce2d
commit 902288f30d

View file

@ -98,7 +98,7 @@ class Module(core.module.Module):
try:
temperature = open(
self.parameter("path", "/sys/class/thermal/thermal_zone0/temp")
).read()[:2]
).read().strip()
log.debug("retrieved temperature from /sys/class/")
# TODO: Iterate through all thermal zones to determine the correct one and use its value
# https://unix.stackexchange.com/questions/304845/discrepancy-between-number-of-cores-and-thermal-zones-in-sys-class-thermal