Skip to content

Commit df800ae

Browse files
author
Brendan Whitfield
committed
don't print the unit field if it's undefined
1 parent 2e20002 commit df800ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

obd/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ def is_null(self):
7373
return (self.message == None) or (self.value == None)
7474

7575
def __str__(self):
76-
return "%s %s" % (str(self.value), str(self.unit))
76+
if self.unit != Unit.NONE:
77+
return "%s %s" % (str(self.value), str(self.unit))
78+
else:
79+
return str(self.value)
7780

7881

7982
class Status():

0 commit comments

Comments
 (0)