From 85934af49a320e4a8a285ed33878d755438eef8b Mon Sep 17 00:00:00 2001 From: lukasmittag Date: Wed, 18 Oct 2023 14:02:02 +0200 Subject: [PATCH] Fixes not setting target values --- csv_provider/provider.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/csv_provider/provider.py b/csv_provider/provider.py index 076136e4..6437eb1a 100755 --- a/csv_provider/provider.py +++ b/csv_provider/provider.py @@ -102,14 +102,18 @@ async def process_rows(client, rows): '''Processes a single row from the CSV-file and write the recorded signal to the data broker through the client.''' for row in rows: - entry = DataEntry( - row['signal'], - value=Datapoint(value=row['value']), - ) if row['field'] == "current": + entry = DataEntry( + row['signal'], + value=Datapoint(value=row['value']), + ) updates = (EntryUpdate(entry, (Field.VALUE,)),) logging.info("Update current value of %s to %s", row['signal'], row['value']) elif row['field'] == "target": + entry = DataEntry( + row['signal'], + actuator_target=Datapoint(value=row['value']) + ) updates = (EntryUpdate(entry, (Field.ACTUATOR_TARGET,)),) logging.info("Update target value of %s to %s", row['signal'], row['value']) else: