Merged cipy-master
authorPhil Howard <phil@gadgetoid.com>
Tue, 20 Aug 2019 15:15:24 +0000 (16:15 +0100)
committerPhil Howard <phil@gadgetoid.com>
Tue, 20 Aug 2019 15:15:24 +0000 (16:15 +0100)
examples/all-in-one-no-pm.py
examples/all-in-one.py
examples/luftdaten.py

index bc19e123d5b7ea175623137f03fa3d13f0c34049..4d6d4635e196fc05598a4db6eac690b4d6186f4b 100755 (executable)
@@ -78,7 +78,7 @@ def display_text(variable, data, unit):
 
 # Get the temperature of the CPU 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 = output.decode()
     return float(output[output.index('=') + 1:output.rindex("'")])
index 695a007e0d33a538fa9f3ca1efc9dbeb90ac45e8..8e82b6b969510cd7fc55c5b854efab3d31185212 100755 (executable)
@@ -84,7 +84,7 @@ def display_text(variable, data, unit):
 
 # Get the temperature of the CPU 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 = output.decode()
     return float(output[output.index('=') + 1:output.rindex("'")])
index 77a6d820d70e327d7affc3ed5f4a887eab19ba02..9995914e23d71144c9f1e99ff11c58f7baaf4e69 100755 (executable)
@@ -72,7 +72,7 @@ def read_values():
 
 # 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 = output.decode()
     return float(output[output.index('=') + 1:output.rindex("'")])