wechselrichter zum tesent eingebunden

This commit is contained in:
Nils Reiners
2025-09-14 10:52:50 +02:00
parent 7df61fd6c1
commit 2186c4d7db
10 changed files with 158 additions and 13 deletions

View File

@@ -18,7 +18,7 @@ class DataBaseCsv:
writer.writerow(data)
return
# If file exists → read existing header and data
# If file exists → read existing header and modbus_registers
with open(self.filename, mode='r', newline='') as csv_file:
reader = csv.DictReader(csv_file)
existing_fields = reader.fieldnames
@@ -39,7 +39,7 @@ class DataBaseCsv:
for row in existing_data:
writer.writerow({field: row.get(field, '') for field in all_fields})
# Write new data row
# Write new modbus_registers row
writer.writerow({field: data.get(field, '') for field in all_fields})
# Replace original file with updated temporary file