Reaplly the Add hide option to sensors plugin #1596 PR

This commit is contained in:
nicolargo 2021-03-13 08:36:48 +01:00
parent d201e647aa
commit 871b4c32b2
2 changed files with 12 additions and 7 deletions

View File

@ -230,9 +230,10 @@ host=127.0.0.1
port=7634
[sensors]
# This plugin is disable by default because on some system, the PsUtil
# consume a lot of CPU to grab the stats...
disable=True
# Documentation: https://glances.readthedocs.io/en/latest/aoa/sensors.html
disable=False
# Hide some sensors
#hide=ambient
# Sensors core thresholds (in Celsius...)
# Default values if not defined: 60/70/80
temperature_core_careful=60

View File

@ -127,14 +127,18 @@ class Plugin(GlancesPlugin):
pass
# Set the alias for each stat
# Global change on stats
self.stats = self.get_init_value()
for stat in stats:
# Do not take hide stat into account
if self.is_hide(stat["label"].lower()):
continue
# Set the alias for each stat
alias = self.has_alias(stat["label"].lower())
if alias:
stat["label"] = alias
# Update the stats
self.stats = stats
# Update the stats
self.stats.append(stat)
return self.stats