brown paper bag commit: always test after changing variable names
[chrisu/seepark.git] / seewasser.py
index 40d2455dc0da2bfcef63d410fba0fe3f04954672..724beb694fef691592b7a60bb370b9d898102eb1 100755 (executable)
@@ -54,9 +54,9 @@ def readsensor(sensor_id):
 
 def writesensordatacsv(config, sensor_id, sensor_name, timestamp, value_type, value_raw, value):
     # Schreiben des csv-files
-    file = open(config.get("csv", "filename"), "a", newline = "")
+    file = open(os.path.expanduser(config.get("csv", "filename")), "a", newline = "")
     writer = csv.writer(file, dialect = "excel")
-    writer.writerow([timestamp.strftime("%Y-%m-%d %H:%M"), sensor_id, "{:.1f}".format(value)])
+    writer.writerow([timestamp.strftime("%Y-%m-%d %H:%M"), sensor_id, sensor_name, "{:.1f}".format(value)])
 
     file.close()