Fix #1333: zero temperature can not be displayed
In __repr__ of Temperature object, the test "if self.value" failed if the temperature is zero.
This commit is contained in:
parent
e7a9fd1482
commit
f667fb972b
1 changed files with 1 additions and 1 deletions
|
|
@ -56,7 +56,7 @@ class Temperature(CapBaseObject):
|
|||
return u'%s°C' % int(round((self.value - 32.0) * 5.0 / 9.0))
|
||||
|
||||
def __repr__(self):
|
||||
if self.value and self.unit:
|
||||
if self.value is not None and self.unit:
|
||||
return u'%s %s' % (self.value, self.unit)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue