Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
Fixes not setting target values
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmittag committed Oct 18, 2023
1 parent b53717c commit 85934af
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions csv_provider/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 85934af

Please sign in to comment.