mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-25 02:02:32 +03:00
Merge branch 'issue1017' of https://github.com/nicolargo/glances into issue1018
This commit is contained in:
commit
5d15fe5feb
@ -19,7 +19,7 @@
|
||||
|
||||
"""Sensors plugin."""
|
||||
|
||||
from psutil import sensors_temperatures
|
||||
import psutil
|
||||
|
||||
from glances.logger import logger
|
||||
from glances.compat import iteritems
|
||||
@ -219,13 +219,14 @@ class Plugin(GlancesPlugin):
|
||||
|
||||
class GlancesGrabSensors(object):
|
||||
|
||||
"""Get sensors stats using the py3sensors library."""
|
||||
"""Get sensors stats."""
|
||||
|
||||
def __init__(self):
|
||||
"""Init sensors stats."""
|
||||
try:
|
||||
sensors_temperatures()
|
||||
except Exception:
|
||||
# XXX: psutil>=5.1.0 is required
|
||||
self.stemps = psutil.sensors_temperatures()
|
||||
except AttributeError:
|
||||
self.initok = False
|
||||
else:
|
||||
self.initok = True
|
||||
@ -246,7 +247,7 @@ class GlancesGrabSensors(object):
|
||||
return self.sensors_list
|
||||
|
||||
# Temperature sensor
|
||||
for chipname, chip in iteritems(sensors_temperatures()):
|
||||
for chipname, chip in iteritems(self.stemps):
|
||||
i = 1
|
||||
for feature in chip:
|
||||
sensors_current = {}
|
||||
|
@ -21,4 +21,3 @@ scandir; python_version < "3.5"
|
||||
statsd
|
||||
wifi
|
||||
zeroconf
|
||||
https://bitbucket.org/gleb_zhulik/py3sensors/get/tip.zip
|
||||
|
Loading…
Reference in New Issue
Block a user