Append file instead of truncation.

This commit is contained in:
2021-10-21 21:10:46 +02:00
parent 42ddb931e4
commit 42f20e5db6
+1 -1
View File
@@ -24,7 +24,7 @@ MQTT::Client.connect(config['mqtt_server']) do |client|
payload = JSON.parse(message)
# Log payload in a csv file
CSV.open('data.csv', 'wb+') do |csv|
CSV.open('data.csv', 'ab') do |csv|
csv << [Time.now,
sensor["name"],
topic,