mirror of https://github.com/nicolargo/glances
Improper bytes/unicode in glances_hddtemp.py #887
parent
97a9365bf8
commit
fd9cc986de
|
@ -131,7 +131,8 @@ class GlancesGrabHDDTemp(object):
|
|||
hddtemp_current['value'] = float(temperature)
|
||||
except ValueError:
|
||||
# Temperature could be 'ERR', 'SLP' or 'UNK' (see issue #824)
|
||||
hddtemp_current['value'] = temperature
|
||||
# Improper bytes/unicode in glances_hddtemp.py (see issue #887)
|
||||
hddtemp_current['value'] = nativestr(temperature)
|
||||
hddtemp_current['unit'] = unit
|
||||
self.hddtemp_list.append(hddtemp_current)
|
||||
|
||||
|
|
|
@ -183,6 +183,7 @@ class Plugin(GlancesPlugin):
|
|||
ret.append(self.curse_add_line(msg, "TITLE"))
|
||||
|
||||
for i in self.stats:
|
||||
logger.info(i)
|
||||
# Do not display anything if no battery are detected
|
||||
if (i['type'] == 'battery' and i['value'] == []):
|
||||
continue
|
||||
|
@ -197,7 +198,7 @@ class Plugin(GlancesPlugin):
|
|||
else:
|
||||
msg = '{:13}'.format(label[:13])
|
||||
ret.append(self.curse_add_line(msg))
|
||||
if i['value'] in (b'ERR', b'SLP', b'UNK'):
|
||||
if i['value'] in (b'ERR', b'SLP', b'UNK', b'NOS'):
|
||||
msg = '{:>8}'.format(i['value'])
|
||||
ret.append(self.curse_add_line(
|
||||
msg, self.get_views(item=i[self.get_key()],
|
||||
|
|
Loading…
Reference in New Issue