We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1e8490b + 2f3349b commit 480fd79Copy full SHA for 480fd79
1 file changed
obd/OBDCommand.py
@@ -122,8 +122,22 @@ def __str__(self):
122
return "%s: %s" % (self.header + self.command, self.desc)
123
return "%s: %s" % (self.command, self.desc)
124
125
- def __repr(self):
126
- return "OBDCommand(%s, %s)" % (self.name, self.command)
+ def __repr__(self):
+ e = self.ecu
127
+ if self.ecu == ECU.ALL:
128
+ e = "ECU.ALL"
129
+ if self.ecu == ECU.ENGINE:
130
+ e = "ECU.ENGINE"
131
+ if self.ecu == ECU.TRANSMISSION:
132
+ e = "ECU.TRANSMISSION"
133
+ if self.header == ECU_HEADER.ENGINE:
134
+ return ("OBDCommand(%s, %s, %s, %s, raw_string, ecu=%s, fast=%s)"
135
+ ) % (repr(self.name), repr(self.desc), repr(self.command),
136
+ self.bytes, e, self.fast)
137
+ return ("OBDCommand" +
138
+ "(%s, %s, %s, %s, raw_string, ecu=%s, fast=%s, header=%s)"
139
140
+ self.bytes, e, self.fast, repr(self.header))
141
142
def __hash__(self):
143
# needed for using commands as keys in a dict (see async.py)
0 commit comments