If "summary" GET parameter is set, return sensor value summary information instead of values.

This commit is contained in:
Michael Stenta 2020-08-25 09:53:28 -04:00
parent 0f0cd5f023
commit 59301f948f
1 changed files with 7 additions and 0 deletions

View File

@ -221,6 +221,13 @@ function farm_sensor_listener_page_callback($public_key) {
*/
drupal_add_http_header('Access-Control-Allow-Origin', '*');
// If value summary info is requested, output it and return success.
if (!empty($params['summary'])) {
$data = farm_sensor_listener_values_info($sensor->id);
drupal_json_output($data);
return MENU_FOUND;
}
// If the 'name' parameter is set, filter by name.
$name = '';
if (!empty($params['name'])) {