From 056049ee038c218037332def39e8c93b33e374af Mon Sep 17 00:00:00 2001 From: Melvin Campos Casares Date: Wed, 21 Oct 2020 19:07:20 +0200 Subject: [PATCH] Fix TypeError preventing script to launch TypeError: argument should be integer or bytes-like object, not 'str' --- examples/compensated-temperature.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/compensated-temperature.py b/examples/compensated-temperature.py index 071bbfb..55fad34 100755 --- a/examples/compensated-temperature.py +++ b/examples/compensated-temperature.py @@ -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