Skip to content

Commit

Permalink
don't print the unit field if it's undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan Whitfield committed Apr 30, 2015
1 parent 2e20002 commit df800ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion obd/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def is_null(self):
return (self.message == None) or (self.value == None)

def __str__(self):
return "%s %s" % (str(self.value), str(self.unit))
if self.unit != Unit.NONE:
return "%s %s" % (str(self.value), str(self.unit))
else:
return str(self.value)


class Status():
Expand Down

0 comments on commit df800ae

Please sign in to comment.