luci-app-statistics: Generate graphs for humidity sensors
This fixes graph generation for sensors that provide humidity data. Suggested-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
This commit is contained in:
parent
41991f8d2a
commit
9f321b831f
2 changed files with 38 additions and 13 deletions
|
@ -7,7 +7,11 @@ return baseclass.extend({
|
|||
title: _('Sensors'),
|
||||
|
||||
rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
|
||||
return {
|
||||
var rv = [];
|
||||
var types = graph.dataTypes(host, plugin, plugin_instance);
|
||||
|
||||
if (types.indexOf('temperature') > -1) {
|
||||
rv.push({
|
||||
per_instance: true,
|
||||
title: "%H: %pi - %di",
|
||||
vlabel: "\xb0C",
|
||||
|
@ -21,6 +25,26 @@ return baseclass.extend({
|
|||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
if (types.indexOf('humidity') > -1) {
|
||||
rv.push({
|
||||
per_instance: true,
|
||||
title: "%H: %pi - %di",
|
||||
vlabel: "%RH",
|
||||
number_format: "%4.1lf %%RH",
|
||||
data: {
|
||||
types: [ "humidity" ],
|
||||
options: {
|
||||
humidity__value: {
|
||||
color: "0000ff",
|
||||
title: "Humidity"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -8,6 +8,7 @@ var sensorTypes = [
|
|||
/^(?:ain|in|vccp|vdd|vid|vin|volt|voltbatt|vrm)[0-9]*$/, 'voltage',
|
||||
/^(?:cpu_temp|remote_temp|temp)[0-9]*$/, 'temperature',
|
||||
/^(?:fan)[0-9]*$/, 'fanspeed',
|
||||
/^(?:humidity)[0-9]*$/, 'humidity',
|
||||
/^(?:power)[0-9]*$/, 'power'
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue