Skip to content

Commit 2b1a2bf

Browse files
author
Brendan Whitfield
committed
using .raw() instead of str()
1 parent 0c28ed6 commit 2b1a2bf

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎obd/decoders.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def pid(messages):
6363

6464
# returns the raw strings from the ELM
6565
def raw_string(messages):
66-
return ("\n".join([str(m) for m in messages]), Unit.NONE)
66+
return ("\n".join([m.raw() for m in messages]), Unit.NONE)
6767

6868
'''
6969
Sensor decoders

‎obd/protocols/protocol.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ def tx_id(self):
8484
def hex(self):
8585
return hexlify(self.data)
8686

87+
def raw(self):
88+
""" returns the original raw input string from the adapter """
89+
return "\n".join([f.raw for f in self.frames])
90+
8791
def parsed(self):
8892
""" boolean for whether this message was successfully parsed """
8993
return bool(self.data)
9094

91-
def __str__(self):
92-
""" returns the original raw input string from the adapter """
93-
return "\n".join([f.raw for f in self.frames])
94-
9595
def __eq__(self, other):
9696
if isinstance(other, Message):
9797
for attr in ["frames", "ecu", "data"]:

0 commit comments

Comments
 (0)