Skip to content

Commit

Permalink
fix: json import attributes at the frame level (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
russkel authored Jan 25, 2025
1 parent eeba45c commit 2fd3297
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/canmatrix/formats/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,14 @@ def load(f, **_options):
new_frame.pdu_name = frame[key]

new_frame.arbitration_id.extended = frame.get("is_extended_frame", False)

if "attributes" in frame:
for k, v in frame["attributes"].items():
new_frame.add_attribute(k, v)

if "transmitters" in frame:
new_frame.transmitters = frame["transmitters"]

for signal in frame["signals"]:
is_little_endian = not signal.get("is_big_endian", False)
is_float = signal.get("is_float", False)
Expand Down

0 comments on commit 2fd3297

Please sign in to comment.