Fix TypeError preventing script to launch

TypeError: argument should be integer or bytes-like object, not 'str'
This commit is contained in:
Melvin Campos Casares authored and GitHub committed 2020-10-21 19:07:20 +02:00
1 parent 7e6bdd0dc4
commit 056049ee03
1 file changed
+1 -1
+1 -1
View File
@@ -32,7 +32,7 @@ sensor.set_filter(bme680.FILTER_SIZE_3)
def get_cpu_temperature():
process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE)
output, _error = process.communicate()
return float(output[output.index('=') + 1:output.rindex("'")])
return float(output[output.index(ord('=')) + 1:output.rindex(ord("'"))])
factor = 1.0 # Smaller numbers adjust temp down, vice versa