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:
Florent 2014-01-22 12:30:28 +01:00
commit f667fb972b

View file

@ -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)