Corrtec an issue with sensors

This commit is contained in:
nicolargo
2021-06-05 10:58:42 +02:00
parent f354d1a2b6
commit c022aa9501
3 changed files with 5 additions and 5 deletions

View File

@@ -315,9 +315,9 @@ class GlancesGrabSensors(object):
else:
sensors_current['label'] = feature.label
# Sensors value, limit and unit
sensors_current['value'] = int(getattr(feature, 'current', 0))
sensors_current['warning'] = int(getattr(feature, 'high', 0))
sensors_current['critical'] = int(getattr(feature, 'critical', 0))
sensors_current['value'] = int(getattr(feature, 'current', 0) if getattr(feature, 'current', 0) else 0)
sensors_current['warning'] = int(getattr(feature, 'high', 0) if getattr(feature, 'high', 0) else 0)
sensors_current['critical'] = int(getattr(feature, 'critical', 0) if getattr(feature, 'critical', 0) else 0)
sensors_current['unit'] = type
# Add sensor to the list
ret.append(sensors_current)

View File

@@ -62,7 +62,7 @@ class Plugin(GlancesPlugin):
# The HDD temp is displayed within the sensors plugin
self.display_curse = False
@GlancesPlugin._check_decorator
# @GlancesPlugin._check_decorator
@GlancesPlugin._log_result_decorator
def update(self):
"""Update battery capacity stats using the input method."""

View File

@@ -52,7 +52,7 @@ class Plugin(GlancesPlugin):
# The HDD temp is displayed within the sensors plugin
self.display_curse = False
@GlancesPlugin._check_decorator
# @GlancesPlugin._check_decorator
@GlancesPlugin._log_result_decorator
def update(self):
"""Update HDD stats using the input method."""