From 47caa1b1186a7136311f7de51ef9c73cc17f6d0e Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 9 Oct 2022 18:45:59 +0200 Subject: [PATCH] FlowPostProcessing::GetJSON: Add `pre` field to the `/json` response This makes it easier for third-party software to fall back to the `pre` value, if the `value` itself is not available for some reason. --- code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp index 94fd0b78..a894ba09 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp @@ -35,6 +35,7 @@ std::string ClassFlowPostProcessing::GetJSON(std::string _id, std::string _mac, else json += " \"value\": \"\"," + _lineend; json += " \"raw\": \"" + NUMBERS[i]->ReturnRawValue + "\"," + _lineend; + json += " \"pre\": \"" + NUMBERS[i]->ReturnPreValue + "\"," + _lineend; json += " \"error\": \"" + NUMBERS[i]->ErrorMessageText + "\"," + _lineend; if (NUMBERS[i]->ReturnRateValue.length() > 0) json += " \"rate\": " + NUMBERS[i]->ReturnRateValue + "," + _lineend;