@cryptotaxi247 / netdata-1 / commits / 230ab58e0

"fahrenheit" functionality removed from "sensors" and "hddtemp"

lgz committed Oct 15, 2017 at 00:05 UTC 230ab58e0b09d09e93b4690dbfb6e16f860c20a1
4 files changed +2 -25
conf.d/python.d/hddtemp.conf
-3
@@ -58,7 +58,6 @@
58 #
59 # host: 'IP or HOSTNAME' # the host to connect to
60 # port: PORT # the port to connect to
61 -# fahrenheit: True/False # fahrenheit instead of celsius. Default is False
61 #
62
63 # By default this module will try to autodetect disks
@@ -78,13 +77,11 @@
77 localhost:
78 name: 'local'
79 host: 'localhost'
81 - fahrenheit: False
80 port: 7634
81
82 localipv4:
83 name: 'local'
84 host: '127.0.0.1'
87 - fahrenheit: False
85 port: 7634
86
87 localipv6:
conf.d/python.d/sensors.conf
+1 -2
@@ -54,5 +54,4 @@ types:
54 # the prefix is matched (anything that starts like that)
55 #
56 #----------------------------------------------------------------------
57 -# To change celsius to fahrenheit uncomment line below
58 -#fahrenheit: True
57 +
python.d/hddtemp.chart.py
+1 -10
@@ -41,7 +41,6 @@ class Service(SocketService):
41 self.request = ""
42 self.host = "127.0.0.1"
43 self.port = 7634
44 - self.fahrenheit = self.configuration.get('fahrenheit')
44 self.disks = list()
45
46 def get_disks(self):
@@ -84,7 +83,7 @@ class Service(SocketService):
83 if not raw[i*5+1] in self.disks:
84 continue
85 try:
87 - val = self.calc_temperature(int(raw[i*5+3]))
86 + val = int(raw[i*5+3])
87 except ValueError:
88 val = 0
89 data[raw[i*5+1].replace("/dev/", "")] = val
@@ -106,14 +105,6 @@ class Service(SocketService):
105 if data is None:
106 return False
107
109 - if self.fahrenheit:
110 - self.definitions['temperatures']['options'][2] = 'Fahrenheit'
111 -
108 for name in data:
109 self.definitions['temperatures']['lines'].append([name])
110 return True
115 -
116 - def calc_temperature(self, value):
117 - if not self.fahrenheit:
118 - return value
119 - return value * 9 / 5 + 32
python.d/sensors.chart.py
-10
@@ -77,7 +77,6 @@ class Service(SimpleService):
77 SimpleService.__init__(self, configuration=configuration, name=name)
78 self.order = list()
79 self.definitions = dict()
80 - self.fahrenheit = self.configuration.get('fahrenheit')
80 self.chips = list()
81
82 def get_data(self):
@@ -95,9 +94,6 @@ class Service(SimpleService):
94 limit = LIMITS[type_name]
95 if val < limit[0] or val > limit[1]:
96 continue
98 - if 'temp' in str(feature.name.decode()):
99 - data[prefix + "_" + str(feature.name.decode())] = int(self.calc_temperature(val) * 1000)
100 - else:
97 data[prefix + "_" + str(feature.name.decode())] = int(val * 1000)
98 except Exception as error:
99 self.error(error)
@@ -123,8 +119,6 @@ class Service(SimpleService):
119 self.order.append(name)
120 chart_def = list(CHARTS[sensor]['options'])
121 chart_def[1] = chip_name + chart_def[1]
126 - if chart_def[2] == 'Celsius' and self.fahrenheit:
127 - chart_def[2] = 'Fahrenheit'
122 self.definitions[name] = {'options': chart_def}
123 self.definitions[name]['lines'] = []
124 line = list(CHARTS[sensor]['lines'][0])
@@ -143,7 +137,3 @@ class Service(SimpleService):
137
138 return True
139
146 - def calc_temperature(self, v):
147 - if not self.fahrenheit:
148 - return v
149 - return v * 9 / 5 + 32