Merge branch 'master' of github.com:pimoroni/enviroplus-python
[EVA-2020-02-2.git] / examples / luftdaten.py
index 27478c590c06088cea81334723a92417de559359..9995914e23d71144c9f1e99ff11c58f7baaf4e69 100755 (executable)
@@ -72,8 +72,9 @@ def read_values():
 
 # Get CPU temperature to use for compensation
 def get_cpu_temperature():
 
 # Get CPU temperature to use for compensation
 def get_cpu_temperature():
-    process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE)
+    process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE, universal_newlines=True)
     output, _error = process.communicate()
     output, _error = process.communicate()
+    output = output.decode()
     return float(output[output.index('=') + 1:output.rindex("'")])
 
 
     return float(output[output.index('=') + 1:output.rindex("'")])