Do not display the unit if the value is empty
This commit is contained in:
parent
03ce941ccf
commit
57e08c6cad
1 changed files with 2 additions and 2 deletions
|
|
@ -60,10 +60,10 @@ class GaugeFormatter(IFormatter):
|
|||
lastvalue = "%d " % sensor.lastvalue.level
|
||||
else:
|
||||
lastvalue = "%r " % sensor.lastvalue.level
|
||||
if not empty(sensor.unit):
|
||||
lastvalue += "%s" % sensor.unit
|
||||
else:
|
||||
lastvalue = u"? "
|
||||
if not empty(sensor.unit):
|
||||
lastvalue += "%s" % sensor.unit
|
||||
if first:
|
||||
result = u' %s %s %s ' %\
|
||||
(self.colored('%-27s' % name[:27], 'red'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue