diff --git a/examples/compensated-temperature.py b/examples/compensated-temperature.py index 55fad34..53e72a5 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(ord('=')) + 1:output.rindex(ord("'"))]) + return float(output[output.index(b'=') + 1:output.rindex(b"'")]) factor = 1.0 # Smaller numbers adjust temp down, vice versa