Skip to content

Commit 1cd06e1

Browse files
committed
Update relay storage considerations
1 parent 9e337e4 commit 1cd06e1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

opensensor/collection_apis.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,10 @@ def sample_and_paginate_collection(
583583
relays = []
584584
for relay in item["relays"]:
585585
try:
586+
if isinstance(relay, str):
587+
relay = json.loads(relay)
588+
if isinstance(relay, list):
589+
relay = relay[0]
586590
relays.append(RelayStatus(**relay))
587591
except Exception as e:
588592
logger.error(f"Error creating RelayStatus: {e}")

0 commit comments

Comments
 (0)