We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 66ef15c commit 9e337e4Copy full SHA for 9e337e4
opensensor/collection_apis.py
@@ -579,17 +579,15 @@ def sample_and_paginate_collection(
579
data = [VPD(**item) for item in raw_data]
580
elif response_model is RelayBoard:
581
data = []
582
- relays = []
583
for item in raw_data:
+ relays = []
584
for relay in item["relays"]:
585
try:
586
- if isinstance(relay, str):
587
- relay = json.loads(relay)
588
relays.append(RelayStatus(**relay))
589
except Exception as e:
590
logger.error(f"Error creating RelayStatus: {e}")
591
pass # Ignore invalid relay data
592
- relay_board = RelayBoard(relays=relays)
+ relay_board = RelayBoard(relays=relays, timestamp=item["timestamp"])
593
data.append(relay_board)
594
else:
595
data = [create_model_instance(response_model, item, unit) for item in raw_data]
0 commit comments