From 97a9365bf87df2a5a9257fb37c686d0f539f83e6 Mon Sep 17 00:00:00 2001 From: Nicolargo Date: Fri, 2 Sep 2016 14:33:38 +0200 Subject: [PATCH] Do not display anything if no battery are detected --- glances/plugins/glances_sensors.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glances/plugins/glances_sensors.py b/glances/plugins/glances_sensors.py index 950211f1..e20c0ad9 100644 --- a/glances/plugins/glances_sensors.py +++ b/glances/plugins/glances_sensors.py @@ -183,6 +183,9 @@ class Plugin(GlancesPlugin): ret.append(self.curse_add_line(msg, "TITLE")) for i in self.stats: + # Do not display anything if no battery are detected + if (i['type'] == 'battery' and i['value'] == []): + continue # New line ret.append(self.curse_new_line()) # Alias for the lable name ?