Skip to content

Commit

Permalink
(fix) Append on bytes in DataArray.to_bytes (#76)
Browse files Browse the repository at this point in the history
Error when creating data from DlmsData. Function returns bytes and not an int so should have been extend instead of append.

Co-authored-by: Henrik Wahlgren <[email protected]>
  • Loading branch information
Krolken and Henrik Wahlgren authored Jan 22, 2024
1 parent 020dfa8 commit a1107ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dlms_cosem/dlms_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class DataArray(BaseDlmsData):
def to_bytes(self) -> bytes:
out = bytearray()
out.append(self.TAG)
out.append(encode_variable_integer(len(self.value)))
out.extend(encode_variable_integer(len(self.value)))
for item in self.value:
out.extend(item.to_bytes())
return bytes(out)
Expand Down

0 comments on commit a1107ba

Please sign in to comment.