Merge pull request #6155 from ukleinek/humidity
luci-app-statistics: Generate graphs for humidity sensors
This commit is contained in:
commit
13903dc997
2 changed files with 38 additions and 13 deletions
|
@ -7,20 +7,44 @@ return baseclass.extend({
|
||||||
title: _('Sensors'),
|
title: _('Sensors'),
|
||||||
|
|
||||||
rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
|
rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
|
||||||
return {
|
var rv = [];
|
||||||
per_instance: true,
|
var types = graph.dataTypes(host, plugin, plugin_instance);
|
||||||
title: "%H: %pi - %di",
|
|
||||||
vlabel: "\xb0C",
|
if (types.indexOf('temperature') > -1) {
|
||||||
number_format: "%4.1lf\xb0C",
|
rv.push({
|
||||||
data: {
|
per_instance: true,
|
||||||
types: [ "temperature" ],
|
title: "%H: %pi - %di",
|
||||||
options: {
|
vlabel: "\xb0C",
|
||||||
temperature__value: {
|
number_format: "%4.1lf\xb0C",
|
||||||
color: "ff0000",
|
data: {
|
||||||
title: "Temperature"
|
types: [ "temperature" ],
|
||||||
|
options: {
|
||||||
|
temperature__value: {
|
||||||
|
color: "ff0000",
|
||||||
|
title: "Temperature"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
};
|
}
|
||||||
|
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',
|
/^(?:ain|in|vccp|vdd|vid|vin|volt|voltbatt|vrm)[0-9]*$/, 'voltage',
|
||||||
/^(?:cpu_temp|remote_temp|temp)[0-9]*$/, 'temperature',
|
/^(?:cpu_temp|remote_temp|temp)[0-9]*$/, 'temperature',
|
||||||
/^(?:fan)[0-9]*$/, 'fanspeed',
|
/^(?:fan)[0-9]*$/, 'fanspeed',
|
||||||
|
/^(?:humidity)[0-9]*$/, 'humidity',
|
||||||
/^(?:power)[0-9]*$/, 'power'
|
/^(?:power)[0-9]*$/, 'power'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue