Update luftdaten.py
authorRichard Hayler <topshed@users.noreply.github.com>
Sat, 3 Aug 2019 19:48:26 +0000 (20:48 +0100)
committerGitHub <noreply@github.com>
Sat, 3 Aug 2019 19:48:26 +0000 (20:48 +0100)
added decoding of bytestring to provide Python3 compatibility.

examples/luftdaten.py

index 4d3d49acd87a86dae17d79f51981f67d75fc261a..99a40c0cdc7dc3562c99986784eda8c040307233 100755 (executable)
@@ -73,6 +73,7 @@ def read_values():
 def get_cpu_temperature():
     process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE)
     output, _error = process.communicate()
 def get_cpu_temperature():
     process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE)
     output, _error = process.communicate()
+    output = output.decode()
     return float(output[output.index('=') + 1:output.rindex("'")])
 
 
     return float(output[output.index('=') + 1:output.rindex("'")])