提交 fd9cc986 编写于 作者: N Nicolargo

Improper bytes/unicode in glances_hddtemp.py #887

上级 97a9365b
......@@ -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()],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册