Skip to content

Commit

Permalink
Avoid posting non recognised sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
oscgonfer committed Jul 9, 2021
1 parent 67d1614 commit 32d48eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scdata/device/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,12 @@ def post_sensors(self, dry_run = False):

rd = dict()
df = self.readings.copy().dropna(axis = 0, how='all')
for col in self.readings: rd[col] = self.sensors[col]['id']
for col in self.readings:
if col not in rd:
std_out(f'Column ({col}) not in recognised IDs. Ignoring', 'WARNING')
df.drop(col, axis=1, inplace=True)
continue
rd[col] = self.sensors[col]['id']

df.rename(columns=rd, inplace=True)

Expand Down

0 comments on commit 32d48eb

Please sign in to comment.