]> arthur.barton.de Git - netdata.git/commitdiff
sensors: fix grouping
authorXuefer <xuefer@gmail.com>
Thu, 8 Sep 2016 19:22:20 +0000 (03:22 +0800)
committerXuefer <xuefer@gmail.com>
Wed, 21 Sep 2016 00:50:16 +0000 (08:50 +0800)
when only single sensor is available, everything is groupped into
temperature

python.d/sensors.chart.py

index 7abe7f0809d45a5f20f47147501bf8126072544f..6fb702aef5901d8a5eb0aabbefa9167fd5aeb1c1 100644 (file)
@@ -92,7 +92,6 @@ class Service(SimpleService):
         return data
 
     def _create_definitions(self):
-        prev_chip = ""
         for type in ORDER:
             for chip in sensors.ChipIterator():
                 chip_name = sensors.chip_snprintf_name(chip)
@@ -105,19 +104,17 @@ class Service(SimpleService):
                         continue
                     if TYPE_MAP[feature.type] == type:
                         # create chart
-                        if chip_name != prev_chip:
-                            name = chip_name + "_" + TYPE_MAP[feature.type]
-                            if name not in self.order:
-                                self.order.append(name)
-                                chart_def = list(CHARTS[type]['options'])
-                                chart_def[1] = chip_name + chart_def[1]
-                                self.definitions[name] = {'options': chart_def}
-                                self.definitions[name]['lines'] = []
+                        name = chip_name + "_" + TYPE_MAP[feature.type]
+                        if name not in self.order:
+                            self.order.append(name)
+                            chart_def = list(CHARTS[type]['options'])
+                            chart_def[1] = chip_name + chart_def[1]
+                            self.definitions[name] = {'options': chart_def}
+                            self.definitions[name]['lines'] = []
                         line = list(CHARTS[type]['lines'][0])
                         line[0] = chip_name + "_" + str(feature.name.decode())
                         line[1] = sensors.get_label(chip, feature)
                         self.definitions[name]['lines'].append(line)
-                prev_chip = chip_name
 
     def check(self):
         try: