Only display the graph fieldset if the sensor has data.

This commit is contained in:
paul121 2020-08-25 14:59:10 -07:00 committed by Michael Stenta
parent 4a2eee85ec
commit cb57c29a93
1 changed files with 5 additions and 0 deletions

View File

@ -694,6 +694,11 @@ function farm_sensor_listener_data_graphs_form($form, &$form_state, $asset) {
// Load distinct sensor value info.
$values = farm_sensor_listener_values_info($asset->id);
// Don't display the graph fieldset if the sensor has no data.
if (empty($values)) {
return array();
}
// Load the distinct value names this sensor has stored.
$names = array_keys($values);