File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -579,17 +579,15 @@ def sample_and_paginate_collection(
579
579
data = [VPD (** item ) for item in raw_data ]
580
580
elif response_model is RelayBoard :
581
581
data = []
582
- relays = []
583
582
for item in raw_data :
583
+ relays = []
584
584
for relay in item ["relays" ]:
585
585
try :
586
- if isinstance (relay , str ):
587
- relay = json .loads (relay )
588
586
relays .append (RelayStatus (** relay ))
589
587
except Exception as e :
590
588
logger .error (f"Error creating RelayStatus: { e } " )
591
589
pass # Ignore invalid relay data
592
- relay_board = RelayBoard (relays = relays )
590
+ relay_board = RelayBoard (relays = relays , timestamp = item [ "timestamp" ] )
593
591
data .append (relay_board )
594
592
else :
595
593
data = [create_model_instance (response_model , item , unit ) for item in raw_data ]
You can’t perform that action at this time.
0 commit comments