Skip to content

Commit

Permalink
Update relay storage considerations
Browse files Browse the repository at this point in the history
  • Loading branch information
matteius committed Oct 6, 2024
1 parent 9e337e4 commit 1cd06e1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions opensensor/collection_apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,10 @@ def sample_and_paginate_collection(
relays = []
for relay in item["relays"]:
try:
if isinstance(relay, str):
relay = json.loads(relay)
if isinstance(relay, list):
relay = relay[0]
relays.append(RelayStatus(**relay))
except Exception as e:
logger.error(f"Error creating RelayStatus: {e}")
Expand Down

0 comments on commit 1cd06e1

Please sign in to comment.