We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1cd06e1 commit 7d41e5fCopy full SHA for 7d41e5f
opensensor/collection_apis.py
@@ -591,8 +591,9 @@ def sample_and_paginate_collection(
591
except Exception as e:
592
logger.error(f"Error creating RelayStatus: {e}")
593
pass # Ignore invalid relay data
594
- relay_board = RelayBoard(relays=relays, timestamp=item["timestamp"])
595
- data.append(relay_board)
+ if relays:
+ relay_board = RelayBoard(relays=relays, timestamp=item["timestamp"])
596
+ data.append(relay_board)
597
else:
598
data = [create_model_instance(response_model, item, unit) for item in raw_data]
599
0 commit comments